Exemple #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;
        }
    }
Exemple #2
0
    /// <summary>
    /// Will load a new scene upon being called
    /// </summary>
    /// <param name="levelName">The name of the level we want
    /// to go to</param>
    public void LoadLevel(string levelName)
    {
        SceneManager.LoadScene(levelName);

        if (UnityAdController.showAds)
        {
            // Show an ad
            UnityAdController.ShowAd();
        }
    }
Exemple #3
0
    /// <summary>
    /// method to load the scene.
    /// </summary>
    /// <param name="nameScene">Name of scene to load</param>
    public void loadScene(string nameScene)
    {
        if (UnityAdController.showAds)
        {
            // show an ad
            UnityAdController.ShowAd();
        }

        SceneManager.LoadScene(nameScene);
    }
Exemple #4
0
    /// <summary>
    /// Load scence
    /// </summary>
    /// <param name="nameScene">Name of the scene to be loaded</param>
    public void loadScene(string nameScene)
    {
        ObstacleBehavior.velocidadeRolamento = 2.0f;

        if (UnityAdController.showAds)
        {
            UnityAdController.ShowAd();
        }

        SceneManager.LoadScene(nameScene);
    }
    /// <summary>
    /// Will load a new scene upon being called
    /// </summary>
    /// <param name="levelName">The name of the level we want
    /// to go to</param>
    public virtual void LoadLevel(string levelName)
    {
        SceneManager.LoadScene(levelName);

        #if UNITY_ADS
        if (UnityAdController.showAds)
        {
            // Show an ad
            UnityAdController.ShowAd();
        }
        #endif
    }
Exemple #6
0
    public void CarregaScene(string nomeScene)
    {
        //Carrega a Scene Tutorial e seta a quantidade de gemas do jogador para 0
        SceneManager.LoadScene(nomeScene);
        ControllerJogo.gems = 0;

#if UNITY_ADS
        // Mostra um Ad quando o jogador começar o Jogo
        if (UnityAdController.showAds)
        {
            UnityAdController.ShowAd();
        }
    #endif
    }