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)); } }
public static void LoseGame() { if (scoreKeeper.score > PlayerPrefsManager.GetScore()) { PlayerPrefsManager.SetScore(scoreKeeper.score); } PlayerPrefsManager.SetNumOfCoins(scoreKeeper.GetCoins()); AdScript.ShowAd(true); }
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); } } }