OldBlueWater/BlueWater/Assets/02.Scripts/Tycoon/TycoonNpc.cs
2024-01-03 11:54:03 +09:00

48 lines
1.6 KiB
C#

using System;
using Sirenix.OdinInspector;
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; }
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");
}
private void Start()
{
StateMachine = gameObject.AddComponent<NpcStateMachine>();
var findTableState = new FindTableState(this);
StateMachine.ChangeState(findTableState);
}
}
}