public void ChangeState(IGameStates newState) { if (gameState != null) { gameState.OnExit(); } gameState = newState; gameState.OnEnter(this); }