コード例 #1
0
    /// <summary>
    /// Reloads our current level, effectively "restarting" the
    /// game
    /// </summary>
    public void Restart()
    {
        //TODO increment the achievements
        if (player)
        {
            GooglePlayGame.CheckAdchievements((int)player.Score);
        }

        if (UnityAdController.restartWithoutAds >= UnityAdController.restartAdsThreshold &&
            UnityAdController.showAds)
        {
            UnityAdController.restartWithoutAds = 0;
            UnityAdController.ShowAd();

            if (pauseMenu.activeInHierarchy)
            {
                pauseMenu.SetActive(false);
            }
        }
        else
        {
            UnityAdController.restartWithoutAds++;
            SceneManager.LoadScene(SceneManager.GetActiveScene().name);
            UnityAdController.nextRewardAvalible = true;
        }
    }
コード例 #2
0
    public override void LoadLevel(string levelName)
    {
        //TODO increment the achievements
        if (player)
        {
            GooglePlayGame.CheckAdchievements((int)player.Score);
        }

        base.LoadLevel(levelName);
    }