Example #1
0
    private IEnumerator StartGameSequence()
    {
        ballManager.ResetAllBalls();
        playersBatManager.HideAllBats();
        Time.timeScale = 1.0f;
        CoreConnector.UIManager.DisplayLevelLoader();

        var levelNumber = PlayerPrefs.GetInt(Constants.CurrentLevel);

        CoreConnector.GameUIManager.playerLifeDisplay.Show();
        CoreConnector.LevelManager.DisplayLevel(levelNumber);

        yield return(WaitCache.WaitForSeconds(0.1f));

        brickManager.LoadLevelsBricks();
        yield return(WaitCache.WaitForSeconds(0.1f));

        backgrounds.DisplayForLevel(levelNumber);
        yield return(WaitCache.WaitForSeconds(0.1f));

        fallingObjectsManager.HideAll();
        yield return(WaitCache.WaitForSeconds(0.1f));

        CoreConnector.UIManager.HideAllScreens();

        yield return(WaitCache.WaitForSeconds(0.1f));

        CoreConnector.UIManager.DisplayScreen(UIScreens.Game);
        CoreConnector.GameUIManager.DisplayInGameButtons(true);
        bonusManager.RestartGame();
        playerLifeManager.RestartLevel();
        yield return(WaitCache.WaitForSeconds(0.1f));

        touchPosition.ResumeGame();
        StartPlay(0.25f);
    }