public void Update() { if (currentState != null) { currentState.InitializeState(this, npc, navMeshAgent, ai_Input); currentState.UpdateState(); if (executionState == ExecutionState.TERMINATED) { EnterState(FSMStateType.IDLE); } } }
public void EnterState(AbstractFSMState nextState) { if (nextState == null) { return; } if (currentState != null) { currentState.ExitState(); } currentState = nextState; currentState.InitializeState(this, npc, navMeshAgent, ai_Input); currentState.EnterState(); }