OldBlueWater/BlueWater/Assets/02.Scripts/Tycoon/TycoonNpc.cs

31 lines
809 B
C#
Raw Normal View History

using System;
using UnityEngine;
using UnityEngine.AI;
// ReSharper disable once CheckNamespace
namespace BlueWaterProject
{
public class TycoonNpc : MonoBehaviour
{
private NpcStateMachine stateMachine;
private NavMeshAgent agent;
private Transform visaualLook;
private TycoonMapInfo mapInfo;
private void Awake()
{
agent = GetComponent<NavMeshAgent>();
agent.updateRotation = false;
mapInfo = GameObject.Find("MapInfo").GetComponent<TycoonMapInfo>();
}
private void Start()
{
stateMachine = gameObject.AddComponent<NpcStateMachine>();
var findTableState = new FindTableState(agent,mapInfo);
stateMachine.ChangeState(findTableState);
}
}
}