2023-12-28 05:42:54 +00:00
|
|
|
using System;
|
2024-01-02 08:17:10 +00:00
|
|
|
using Sirenix.OdinInspector;
|
2023-12-28 05:42:54 +00:00
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.AI;
|
2024-01-02 08:17:10 +00:00
|
|
|
using UnityEngine.UI;
|
2023-12-28 05:42:54 +00:00
|
|
|
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
|
|
namespace BlueWaterProject
|
|
|
|
{
|
|
|
|
public class TycoonNpc : MonoBehaviour
|
|
|
|
{
|
2024-01-02 08:17:10 +00:00
|
|
|
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; }
|
2023-12-28 05:42:54 +00:00
|
|
|
|
2024-01-02 08:17:10 +00:00
|
|
|
[Title("FoodOrderState")]
|
|
|
|
public Image BarkImg { get; set; }
|
|
|
|
public Image BarkFillImg { get; set; }
|
|
|
|
public Image FoodImg { get; set; }
|
|
|
|
public Transform EmojiTransform { get; set; }
|
2023-12-28 05:42:54 +00:00
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
{
|
2024-01-02 08:17:10 +00:00
|
|
|
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");
|
2023-12-28 05:42:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private void Start()
|
|
|
|
{
|
2024-01-02 08:17:10 +00:00
|
|
|
StateMachine = gameObject.AddComponent<NpcStateMachine>();
|
2023-12-28 05:42:54 +00:00
|
|
|
|
2024-01-02 08:17:10 +00:00
|
|
|
var findTableState = new FindTableState(this);
|
|
|
|
StateMachine.ChangeState(findTableState);
|
2023-12-28 05:42:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|