Beispiel #1
0
    public void LoadLevelCompleteMenu()
    {
        Time.timeScale        = 0;
        MapUtility.GamePaused = true;
        var    nextLevelIndex = MapUtility.GetLevelNumber(SceneManager.GetActiveScene().name, "") + 1;
        string nextLevel      = "Level " + nextLevelIndex;

        SaveManager.Instance().UnlockLevel(nextLevel);
        levelSelectionMenuObject.UpdateLevels();

        //se livello successivo è l'8, next level non interagibile
        if (nextLevelIndex == 8)
        {
            var panel           = LevelCompleteMenu.transform.GetChild(0);
            var buttonNextLevel = panel.GetChild(1);
            var coomingSoon     = panel.GetChild(2);

            buttonNextLevel.gameObject.SetActive(false);
            coomingSoon.gameObject.SetActive(true);
        }
        else
        {
            var panel           = LevelCompleteMenu.transform.GetChild(0);
            var buttonNextLevel = panel.GetChild(1);
            var coomingSoon     = panel.GetChild(2);

            buttonNextLevel.gameObject.SetActive(true);
            coomingSoon.gameObject.SetActive(false);
        }

        LevelCompleteMenu.SetActive(true);
    }
Beispiel #2
0
    public void FromLevelCompleteToNextLevel()
    {
        Time.timeScale = 1;
        AudioManager.Instance().StopAllInGameSfx();
        var    nextLevelIndex = MapUtility.GetLevelNumber(SceneManager.GetActiveScene().name, "") + 1;
        string nextLevel      = "Level " + nextLevelIndex;

        LevelCompleteMenu.SetActive(false);
        LevelManager.LoadLevel(nextLevel);
    }
Beispiel #3
0
    public void FromLevelCompleteToMainMenu()
    {
        Time.timeScale = 1;
        AudioManager.Instance().StopAllInGameSfx();
        LevelCompleteMenu.SetActive(false);
        var    nextLevelIndex = MapUtility.GetLevelNumber(SceneManager.GetActiveScene().name, "") + 1;
        string nextLevel      = "Level " + nextLevelIndex;

        //se livello successivo non è l'ultimo disponbile,
        //viene salvato per il pulsante 'continue'
        if (nextLevelIndex != 8)
        {
            SaveManager.Instance().SaveLastScene(nextLevel);
        }
        loadMainMenu();
        LevelManager.LoadLevel("MenuScene");
    }