private void Update() { if (changeScene == false) { timer -= Time.deltaTime; if (timer <= 0) { if (_EFDeathCount <= 0) { _victor = "Zion"; FadeScript fs = Fade.GetComponent <FadeScript>(); fs.Fade(true); sceneIndex = 3; StartCoroutine(WaitForFade()); } if (_ZionDeathCount <= 0) { FadeScript fs = Fade.GetComponent <FadeScript>(); fs.Fade(true); sceneIndex = 2; StartCoroutine(WaitForFade()); } } } }
//Espera o fade para carregar a nova cena IEnumerator FadeAndLoad(string scene) { yield return(StartCoroutine (fade.Fade(Color.clear, Color.black))); SceneManager.LoadScene(scene); }
public IEnumerator RollCredits() { EventManager.TriggerEvent("FinishGame"); FadeScript fade = FindObjectOfType <FadeScript>(); if (fade != null) { fade.Fade(); } yield return(new WaitForSeconds(1.6f)); dialoguePanelController.PopUp = false; yield return(new WaitForSeconds(1.5f)); sceneHandler.LoadScene("09_Credits"); }
IEnumerator DialogueScene_1() { CharacterSelection(); UpdateText(); UpdatePanelProfile(); panel.enabled = true; profile.enabled = true; text.enabled = true; yield return(new WaitForSeconds(timeBetweenSentances)); index++; if (index < sentances.Length) { StartCoroutine(DialogueScene_1()); } else { FadeScript fs = fadeObj.GetComponent <FadeScript>(); fs.Fade(true); Invoke("ChangeScene", 1); } }