Esempio n. 1
0
    void SetActiveButler(GameType gameType)
    {
//		gav4.LogEvent (CATEGORY, "SetActiveButler", gameType.ToString (), 0);
        switch (gameType)
        {
        case GameType.ONE_PLAYER_AI:
            butler = butlerAi;
            break;

        case GameType.TWO_PLAYER_PLAY_GAMES:
            butler = butlerPlayGames;
            break;

        default:
            throw new NotImplementedException();
        }
    }
Esempio n. 2
0
    void HandleGameStateChanged(GameState state)
    {
        if (masterGameState == state)
        {
            if (masterGameState != GameState.INITIALIZING_APP)
            {
                Debug.Log("***Ignoring GameState switch as we're already in " + masterGameState);
            }
            return;
        }
        gav4.LogScreen(state.ToString());
        Debug.Log("===> GameState: " + masterGameState + " --> " + state);
        masterGameState = state;
        switch (state)
        {
        case GameState.GAME_WAS_TORN_DOWN:
            if (butler != null)
            {
                Assert.IsTrue(butler.enabled);
                butler.enabled = false;
                butler         = null;
            }
            foreach (GameObject go in tempObjects)
            {
                Destroy(go);
            }
            SceneMaster.instance.StopAllCoroutines();
            StartCoroutine(NextFrameChangeGameState(GameState.GAME_WAS_TORN_DOWN, GameState.SELECTING_GAME_TYPE));
            break;

        case GameState.SELECTING_GAME_TYPE:
        case GameState.AUTHENTICATING:
        case GameState.SETTING_UP_GAME:
        case GameState.TEARING_DOWN_GAME:
        case GameState.PLAYING:
        case GameState.SELECTING_VIEW_MODE:
            MakeGameObjectsActive();
            break;

        default:
            throw new NotImplementedException();
        }
    }