public void Back() { FindObjectOfType <AudioCreater>().PlayClick(); FindObjectOfType <AudioCreater>().ResumeTheme(); if (PlayerPrefs.GetInt("levelReached") < SceneManager.GetActiveScene().buildIndex - 1) { PlayerPrefs.SetInt("levelReached", SceneManager.GetActiveScene().buildIndex - 1); } SimpleAds.RequestInterstitial(); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex - 18); }
IEnumerator NextLevel() { yield return(new WaitForSeconds(timeDelay)); if (PlayerPrefs.GetInt("levelReached") < SceneManager.GetActiveScene().buildIndex - 1) { PlayerPrefs.SetInt("levelReached", SceneManager.GetActiveScene().buildIndex - 1); } if (Random.Range(0, 2) == 0) { SimpleAds.RequestInterstitial(); } SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); }