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); } }
// Adds given level ender as invoker of end level event public static void AddEndLevelInvoker(LevelEnder invoker) { // adds invoker to list and adds all listeners to this invoker endLevelInvokers.Add(invoker); foreach (UnityAction <bool, float> listener in endLevelListeners) { invoker.AddEndLevelListener(listener); } }
void Update() { if (CurrentPercentsByTime() == 100) { LevelEnd levelEnd = DialogueSystem.DialogueStarted() ? LevelEnd.INTERRUPTED : LevelEnd.PATIENT; LevelEnder.EndGame(levelEnd); } if (!dragging) { UpdateInnerBarPosition(); } UpdatePercentsText(); }
void Awake() { if (SceneManager.GetActiveScene().buildIndex == 0 || instance == null) { if (instance != null) { Destroy(instance.gameObject); } instance = this; DontDestroyOnLoad(gameObject); audioSource = GetComponent <AudioSource>(); levelEnd = LevelEnd.TEST; } else { Destroy(gameObject); } }