Exemplo n.º 1
0
 void OnTriggerEnter(Collider coll)
 {
     if (coll.name == "Player")
     {
         Debug.Log("ResetColl");
         if (!tutorial)
         {
             if (ad != null)
             {
                 if (timeB > lifeAdTime)
                 {
                     StartCoroutine(ad.ShowAd(1));
                 }
                 else
                 {
                     SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
                 }
             }
             else
             {
                 SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
             }
         }
     }
     if (coll.tag == "Enemy")
     {
         StartCoroutine(EnemyKilled(coll.gameObject));
     }
 }
Exemplo n.º 2
0
    public static void LoseGame()
    {
        if (scoreKeeper.score > PlayerPrefsManager.GetScore())
        {
            PlayerPrefsManager.SetScore(scoreKeeper.score);
        }

        PlayerPrefsManager.SetNumOfCoins(scoreKeeper.GetCoins());
        AdScript.ShowAd(true);
    }
Exemplo n.º 3
0
    IEnumerator DeathClock()
    {
        yield return(new WaitForSeconds(deathTime));

        //SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);

        if (ad != null)
        {
            StartCoroutine(ad.ShowAd(1));
        }
        else
        {
            if (SceneManager.GetActiveScene().buildIndex == 2)
            {
                GameObject.Find("TutorialObj").GetComponent <TutorialScript>().Reset(GetComponent <CapsuleCollider>());
                BackToLife();
            }
            else
            {
                SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
            }
        }
    }