public void ChangeState(GameState gameState) { if (gameStates.Count == 0) { gameStates.Add(gameState); } else { gameStates[gameStates.Count - 1].Unload(); gameStates[gameStates.Count - 1] = null; gameStates[gameStates.Count - 1] = gameState; gameState.Init(); } }
public void PushState(GameState gameState) { gameStates.Add(gameState); gameState.Init(); }