Exemplo n.º 1
0
 public override void TransitionToState(State nextState)
 {
     if (nextState != remainState)
     {
         currentState.OnExitState(this);
         currentState = nextState;
         currentState.OnEnterState(this);
         OnExitState();
     }
 }
Exemplo n.º 2
0
 public override void TransitionToState(State nextState)
 {
     if (nextState != remainState)
     {
         currentState.OnExitState(this);
         currentState = nextState;
         currentState.OnEnterState(this);
         if (currentState != inactiveState)
         {
             lastActiveState = currentState;
         }
         OnExitState();
     }
 }