예제 #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();
 }