コード例 #1
0
ファイル: StateMachine.cs プロジェクト: Simon-Guldager/su18
        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;
            }
        }
コード例 #2
0
 public static SelectLevel GetInstance()
 {
     return(SelectLevel.instance ?? (SelectLevel.instance =
                                         new SelectLevel()));
 }