public void SwitchState(GameStateBase state, object data) { if (gameState != null) { gameState.End(); } gameState = state; gameState.MyManager = this; gameState.Init(data); }
public GameStateManager() { gameState = null; }