コード例 #1
0
        public void SwitchState(GameStateType stateType)
        {
            switch (stateType)
            {
            case GameStateType.GameRunning:
                ActiveState = GameRunning.GetInstance();
                break;

            case GameStateType.GamePaused:
                ActiveState = GamePaused.GetInstance();
                break;

            case GameStateType.MainMenu:
                ActiveState = MainMenu.GetInstance();
                break;

            case GameStateType.ChooseLevel:
                ActiveState = ChooseLevel.GetInstance();
                break;
            }
        }
コード例 #2
0
ファイル: ChooseLevel.cs プロジェクト: MadsHaderup/exam-2020
 public static ChooseLevel GetInstance()
 {
     return(ChooseLevel.instance ?? (ChooseLevel.instance = new ChooseLevel()));
 }