void GetCurrentSessionScore(out int returnLevel, out int returnScore)
    {
        GameStateBase.GameSessionData sessionData = GameManager.instance.GetGameSessionData();

        returnLevel = sessionData.levelIndex;
        returnScore = sessionData.totalScore;
    }
Exemple #2
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();
    }