Exemplo n.º 1
0
 public void SetStateAnyway(CharacterBaseState newState, CharacterBaseState nextState)
 {
     if (CurrentState != newState)
     {
         CurrentState.OnExit();
         PreviousState          = CurrentState;
         CurrentState           = newState;
         CurrentState.NextState = nextState;
         OnStateChange(PreviousState, CurrentState);
         CurrentState.Initialize();
     }
 }
Exemplo n.º 2
0
 public void SetStateOverride(CharacterBaseState newState)
 {
     if (CurrentState != newState)
     {
         if (CurrentState.CanBeOverriden)
         {
             CurrentState.OnExit();
             PreviousState          = CurrentState;
             CurrentState           = newState;
             CurrentState.NextState = null;
             OnStateChange(PreviousState, CurrentState);
             CurrentState.Initialize();
         }
     }
 }