IEnumerator StartLevel() { fading.FadeOut(fadingTime); yield return(new WaitForSeconds(fadingTime)); // fading.FadeIn(fadingTime); StartGame(); }
IEnumerator FadeOutBeforeLevelEnd() { //fade out when end fade.FadeOut(); while (fade.fadeOutDone == false) { yield return(new WaitForSeconds(0.05f)); } EventManager.TriggerEvent("Level Ended"); }
/* * Create lose effect and activates canvas group */ public IEnumerator Restart() { yield return(StartCoroutine(_writer.WriteNarration("No wonder you were caught in the first place"))); yield return(new WaitForSeconds(1.5f)); _sceneFader.FadeOut(); GetComponent <CanvasGroup>().blocksRaycasts = true; _restart.SetActive(true); }
public override void StartInteraction() { Wait(1, () => { StartCoroutine(ZoomOutCamera()); base.StartInteraction(); Wait(5, () => { SecondDialog.ShowBubble(); Wait(2f, () => { particles.Play(); Wait(0.3f, () => Sister.sprite = Resources.Load("sister", typeof(Sprite)) as Sprite); Wait(4, () => thirdDialog.ShowBubble()); Wait(8, () => fading.FadeOut()); Wait(10, End); //TODO HACK}); }); }); }); }
IEnumerator ChangeScene(int scene) { fading.FadeOut(fadingTime); yield return(new WaitForSeconds(fadingTime)); SceneManager.LoadScene(scene); }
IEnumerator delayWait() { //print("waiting"); yield return(new WaitForSeconds(displayTime)); fading.FadeOut(); yield return(new WaitForSeconds(fading.fadeSpeed + 0.5f)); Application.LoadLevel("TitleScreen"); }
public IEnumerator RunGame() { //print("waiting"); if (hasSeenTutorial) { tutorial.gameObject.SetActive(false); fading.gameObject.SetActive(true); fading.FadeOut(); yield return(new WaitForSeconds(fading.fadeSpeed)); //print("load main"); Application.LoadLevel("Main"); } else { tutorial.gameObject.SetActive(true); tutorial.willReturnToMenu(false); hasSeenTutorial = true; PlayerPrefs.SetInt("HasSeenTutorial", 1); } }
/* * Specific function for menu * Fades into game * Cannot use that of regular scene handler because conflicts in terms of facilities used, e.g. inventory doesn't exist here */ public void ToGame() { _fader.FadeOut(); StartCoroutine(WaitToFade()); }