void backToMap() { StartCoroutine(FadingIntoCityMap()); if (ButtonShop.paused) { ButtonShop.togglePause(); } SaveManager.updateSave(); PlayGamesScript.Instance.SaveData(); }
void GameOver() { MusicManager.StopBGM(); SfxManager.PlaySound("GameOver"); StartCoroutine(playAfterTime(1f)); ButtonShop.paused = false; ButtonShop.togglePause(); gameOverScreen.SetActive(true); }
void again() { StartCoroutine(FadingIntoFightScene()); if (ButtonShop.paused) { ButtonShop.togglePause(); } SaveManager.updateSave(); PlayGamesScript.Instance.SaveData(); }
void win() { //pause game ButtonShop.togglePause(); FloatingTextController.pause = true; scoreScreen.SetActive(true); GUIText[] allText = scoreScreen.GetComponentsInChildren <GUIText>(); //Find the Text to change to correct amount foreach (GUIText i in allText) { if (i.text == "XXX Gold") { float goldEarned = SaveManager.Instance.goldEarned; i.text = goldEarned.ToString(".##") + " Gold"; break; } } }
IEnumerator FadingIntoFightMap() { fadeAnim.SetBool("FadeOut", true); SaveManager.Instance.savePlayerPos(); ButtonShop.togglePause(); yield return(new WaitUntil(() => black.color.a == 1)); if (gameObject.scene.name == "City map") { SceneManager.LoadScene("Fight scene"); } else if (gameObject.scene.name == "Forest map") { SceneManager.LoadScene("Fight scene 1"); } else if (gameObject.scene.name == "Snow map") { SceneManager.LoadScene("Fight scene 2"); } }
IEnumerator FadingIntoFightScene() { fadeAnim.SetBool("FadeOut", true); ButtonShop.togglePause(); resetFight(); yield return(new WaitUntil(() => black.color.a == 1)); //SceneManager.LoadScene(SceneManager.GetActiveScene().name); if (gameObject.scene.name == "Fight scene") { SceneManager.LoadScene("Fight scene"); } else if (gameObject.scene.name == "Fight scene 1") { SceneManager.LoadScene("Fight scene 1"); } else if (gameObject.scene.name == "Fight scene 2") { SceneManager.LoadScene("Fight scene 2"); } }
void changePaused() { ButtonShop.togglePause(); }