コード例 #1
0
    public void OnUpdateGameState(GameState aNewGameState)
    {
        switch (aNewGameState.gameMode)
        {
        case GameModeEnum.PLAYING:
            this.cursorMode = PlayModeChooseMode(GM.playManager.currentState);
            break;

        case GameModeEnum.EDITING:
            break;

        case GameModeEnum.PLAYTESTING:
            this.cursorMode = PlayModeChooseMode(GM.playManager.currentState);
            break;

        default:
            throw new ArgumentOutOfRangeException();
        }
    }
コード例 #2
0
    void OnUpdateEditorState(EditorState aNewEditorState)
    {
        switch (GM.instance.currentState.gameMode)
        {
        case GameModeEnum.PLAYING:
            throw new Exception("received OnUpdateEditorState but GameState.gameMode = PLAYING");

        case GameModeEnum.EDITING:
            this.isFront        = aNewEditorState.isFront;
            this.selectedSchema = aNewEditorState.selectedSchema;
            this.cursorMode     = EditModeChooseMode(aNewEditorState);
            break;

        case GameModeEnum.PLAYTESTING:
            throw new Exception("received OnUpdateEditorState updated but GameState.gameMode = PLAYING");

        default:
            throw new ArgumentOutOfRangeException();
        }
    }
コード例 #3
0
    void OnUpdatePlayState(PlayState aNewPlayState)
    {
        switch (GM.instance.currentState.gameMode)
        {
        case GameModeEnum.PLAYING:
            print("cursor OnUpdatePlayState");
            this.isFront        = true;
            this.selectedSchema = null;
            this.cursorMode     = PlayModeChooseMode(aNewPlayState);
            break;

        case GameModeEnum.EDITING:
            throw new Exception("received OnUpdatePlayState but GameState.gameMode = PLAYING");

        case GameModeEnum.PLAYTESTING:
            this.isFront        = true;
            this.selectedSchema = null;
            this.cursorMode     = PlayModeChooseMode(aNewPlayState);
            break;

        default:
            throw new ArgumentOutOfRangeException();
        }
    }
コード例 #4
0
 void OnEnable()
 {
     this.cursorMode = CursorModeEnum.POINTING;
     GM.editManager.OnUpdateEditorState += OnUpdateEditorState;
     GM.playManager.OnUpdatePlayState   += OnUpdatePlayState;
 }