public void SwitchState(GameStateType stateType) { switch (stateType) { case GameStateType.GameRunning: ActiveState = GameRunning.GetInstance(); break; case GameStateType.MainMenu: ActiveState = MainMenu.GetInstance(); break; case GameStateType.SelectLevel: ActiveState = SelectLevel.GetInstance(); break; case GameStateType.GamePaused: ActiveState = GamePaused.GetInstance(); break; } }
public static SelectLevel GetInstance() { return(SelectLevel.instance ?? (SelectLevel.instance = new SelectLevel())); }