61 lines
2.1 KiB
C#
61 lines
2.1 KiB
C#
using System;
|
|
using Sirenix.OdinInspector;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.AI;
|
|
using UnityEngine.UI;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace BlueWaterProject
|
|
{
|
|
public class TycoonNpc : MonoBehaviour
|
|
{
|
|
public NpcStateMachine StateMachine { get; set; }
|
|
public NavMeshAgent Agent { get; set; }
|
|
public Transform VisaualLook { get; set; }
|
|
public TycoonMapInfo MapInfo { get; set; }
|
|
|
|
[Title("FindTableState")]
|
|
public bool DoSeat { get; set; }
|
|
public Seat AssignedSeat { get; set; }
|
|
|
|
[Title("FoodOrderState")]
|
|
public Image BarkImg { get; set; }
|
|
public Image BarkFillImg { get; set; }
|
|
public Image FoodImg { get; set; }
|
|
public Transform EmojiTransform { get; set; }
|
|
public bool IsGetFood { get; set; }
|
|
public bool IsGetDrink { get; set; }
|
|
|
|
[Title("PayState")]
|
|
public PayController PayController { get; set; }
|
|
public GameObject PayTextObj { get; set; }
|
|
public TextMeshProUGUI PayText { get; set; }
|
|
public Animator PayTextAni { get; set; }
|
|
|
|
private void Awake()
|
|
{
|
|
Agent = GetComponent<NavMeshAgent>();
|
|
Agent.updateRotation = false;
|
|
MapInfo = GameObject.Find("MapInfo").GetComponent<TycoonMapInfo>();
|
|
|
|
BarkImg = transform.Find("Canvas/BarkImg").GetComponent<Image>();
|
|
BarkFillImg = transform.Find("Canvas/BarkFillImg").GetComponent<Image>();
|
|
FoodImg = transform.Find("Canvas/FoodImg").GetComponent<Image>();
|
|
EmojiTransform = transform.Find("Emoji");
|
|
|
|
PayController = MapInfo.Counter.GetComponent<PayController>();
|
|
PayTextObj = transform.Find("Canvas/PayText").gameObject;
|
|
PayText = PayTextObj.GetComponent<TextMeshProUGUI>();
|
|
PayTextAni = PayTextObj.GetComponent<Animator>();
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
StateMachine = gameObject.AddComponent<NpcStateMachine>();
|
|
|
|
var findTableState = new FindTableState(this);
|
|
StateMachine.ChangeState(findTableState);
|
|
}
|
|
}
|
|
} |