Пример #1
0
 public void ChangeState(PlayerBaseState newState)
 {
     if (currentState != null)
     {
         currentState.Exit();
     }
     newState.Enter();
     currentState = newState;
 }
Пример #2
0
    public void TransitionToState(PlayerBaseState state)
    {
        if (currentState != null)
        {
            currentState.Exit(this);
        }

        currentState = state;

        currentState.Enter(this);
    }
Пример #3
0
 public void ChangeState(PlayerBaseState newState)
 {
     currentState.Exit();
     currentState = newState;
     newState.Enter();
 }