Beispiel #1
0
 private void TransitionState()
 {
     foreach (StateTransition transition in currentState.transitions)
     {
         //should probably prioritize states with a value of some sort
         if (transition.CanTransition())
         {
             currentState.Disable();
             currentState = transition.nextState;
             currentState.Enable();
             return;
         }
     }
 }
Beispiel #2
0
 public void SetInitialState(NPC_BehaviorState behavior)
 {
     this.currentState = behavior;
     currentState.Enable();
 }