using UnityEngine; using UnityEngine.AI; // ReSharper disable once CheckNamespace namespace BlueWaterProject { public class Npc : BaseCharacter { private NpcStateMachine stateMachine; private NavMeshAgent agent; public Transform[] usuallyPoints; protected override void Start() { base.Start(); agent = GetComponent(); stateMachine = gameObject.AddComponent(); var usuallyPointState = new UsuallyPointState(agent, usuallyPoints); stateMachine.ChangeState(usuallyPointState); } protected override void Update() { base.Update(); stateMachine.Update(); // 필요하면 플레이어의 명령을 처리하는 로직을 추가 } } }