Пример #1
0
    private void ChangeGameState(GameStateBase newGameState)
    {
        if (currentGameState != null)
        {
            GameStateBase.GameSessionData previousSessionData = currentGameState.GetSessionData();
            newGameState.PassSessionData(previousSessionData);
            currentGameState.CleanupGameState();
        }

        currentGameState = newGameState;



        if (playerBallObject == null)
        {
            throw new System.Exception("playerBallObject not found by GameManager.");
        }


        currentGameState.StartGameState();
    }