public static void CloseDialogue() { if (!instance.isDialogueShown) { return; } instance.wrapper.SetActive(false); instance.isDialogueShown = false; instance.currentLinesIndex++; if (instance.currentLinesIndex >= instance.currentDialogueLines.Length) { AcceptingInputStatus.DisableAcceptingInput(); LevelEnder.EndGame(instance.currentLevelEnd); return; } if (instance.currentDialogueLines[instance.currentLinesIndex - 1].showNextLineAfterThis) { instance.wrapper.SetActive(true); // to not blink away for the one frame Trigger(instance.currentLevelEnd); } }
IEnumerator EndGameCoroutine(LevelEnd levelEnd) { DialogueSystem.CloseDialogue(); LoadingBar.OnDisableInput(); AcceptingInputStatus.DisableAcceptingInput(); BackgroundSoundPlayer.Stop(); if (levelEnd == LevelEnd.IMPATIENT) { audioSource.PlayOneShot(fart); LoadingBar.FillRestOfLoadingBar(fart.length); yield return(new WaitForSeconds(fart.length)); } if (levelEnd != LevelEnd.HEART && levelEnd != LevelEnd.SHAKE) { audioSource.PlayOneShot(toiletFlushing); yield return(new WaitForSeconds(toiletFlushing.length)); } MainCamera.ZoomOut(); if (levelEnd == LevelEnd.SHAKE) { Door.OpenDoorCensored(); dwarf.GetComponentInChildren <Renderer>().material = dwarfToiletPapered; } else { Door.OpenDoor(); } audioSource.PlayOneShot(doorSqueak); yield return(new WaitForSeconds(doorSqueak.length)); dwarf.SetActive(true); dwarf.GetComponentInChildren <Animator>().speed = 1 / footSteps.length; audioSource.PlayOneShot(footSteps); yield return(new WaitForSeconds(footSteps.length)); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); }
void Awake() { instance = this; isAcceptingInput = true; }