private IEnumerator PlayDialogue(int fromIndex, int toIncludingIndex) { _currentDialogueIndex = fromIndex; for (int i = fromIndex; i < toIncludingIndex; i++) { yield return(new WaitForSeconds(2)); _currentDialogueIndex = i; NextDialogue(); yield return(new WaitForSeconds(_dialogue[_currentDialogueIndex].Delay)); } string currentScene = SceneManager.GetActiveScene().name; if (currentScene == "Intro") { if (_currentDialogueIndex == _dialogue.Count - 1) { _isDialoguePlaying = false; _fadingController.Fade("in", "MainScene"); } } else if (currentScene == "Ending") { _fadingController.ResetAnimator(); _fadingController.Fade("in", "MainScene"); PlayerController.Instance.isGameCompleted = true; } }
private void Start() { _introContainer = GameObject.Find("Intro"); _fadingController = FindObjectOfType <FadingController>(); if (isGameCompleted) { _introContainer.SetActive(false); ScreenInitialization.SetActive(true); _fadingController.Fade("out", string.Empty); } isGameStarted = false; }
public void UpdateIndicatorsStatus() { int indicatorsActive = 0; foreach (HUDIndicatorController indicator in HUDIndicators) { if (indicator != null) { indicator.UpdateStatus(); if (indicator.IsTargetFound) { indicatorsActive++; } } } // End game transition if (indicatorsActive >= 5) { AudioManager.Instance.AudioController.PlaySound("End Game Sound"); _fadingController.Fade("in", "Ending"); } }