コード例 #1
0
        public StateMachine()
        {
            GalagaBus.GetBus().Subscribe(GameEventType.GameStateEvent, this);
            GalagaBus.GetBus().Subscribe(GameEventType.InputEvent, this);

            ActiveState = MainMenu.GetInstance();
        }
コード例 #2
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.GameLost:
                ActiveState = GameLost.GetInstance();
                break;

            case GameStateType.GameWon:
                ActiveState = GameWon.GetInstance();
                break;
            }
        }
コード例 #3
0
        private void SwitchState(StateTransformer.GameStateType stateType)
        {
            switch (stateType)
            {
            case StateTransformer.GameStateType.MainMenu:
                ActiveState = MainMenu.GetInstance();
                break;

            case StateTransformer.GameStateType.GameRunning:
                ActiveState = GameRunning.GetInstance(game);
                break;

            case StateTransformer.GameStateType.GamePaused:
                ActiveState = GamePaused.GetInstance();
                break;
            }
        }
コード例 #4
0
 public void UpdateGameLogic()
 {
     MainMenu.GetInstance();
 }