Ejemplo n.º 1
0
    public void NextPuzzle()
    {
        if (currentPuzzleIterator < PuzzleList.Count - 1)
        {
            currentPuzzleIterator++;

            var puzzleToInstantiate = PuzzleList[currentPuzzleIterator];
            CurrentPuzzleName = puzzleToInstantiate.PuzzleName;
            //winDialog.transform.Find("CanvasGroup").gameObject.SetActive(false);
            InstantiatePuzzleInGameWorld(puzzleToInstantiate);

            if (puzzleBeaten)
            {
                if (AdSystem.ShouldWeShowAd(CurrentPuzzleCategory))
                {
                    GameObject.Find("AdController").GetComponent <InterstitialAdScript>().LaunchInterstitalAd();
                }
            }

            ResetLevelToDefaults();
        }
        else if (puzzleBeaten && currentPuzzleIterator == PuzzleList.Count - 1)       // Just beat the last puzzle of the category, send them back to category menu.
        {
            PlayerPrefs.SetString("MenuToShow", "PuzzleCategorySelectorCanvas");
            SceneManager.LoadScene("Main");
        }
    }