Beispiel #1
0
 public void Update()
 {
     if (currentState != null)
     {
         currentState.InitializeState(this, npc, navMeshAgent, ai_Input);
         currentState.UpdateState();
         if (executionState == ExecutionState.TERMINATED)
         {
             EnterState(FSMStateType.IDLE);
         }
     }
 }
Beispiel #2
0
        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();
        }