Example #1
0
 public void ChangeState(IGameStates newGameState)
 {
     previousGameState = currentGameState;
     if (previousGameState != null)
     {
         previousGameState.OnStateExit();
     }
     currentGameState = newGameState;
     currentGameState.OnStateEnter();
 }