//////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> // /// </summary> public void NewWaveNotification(WaveManager.WaveInfo waveInfo) { if (WaveNameDescription != null) { // Next wave is a boss wave - only show title text if (_BossWave) { WaveNameTitle.text = "BOSS WAVE"; _TimerOnScreen = 0f; _OnScreen = true; gameObject.SetActive(true); WaveNameDescription.enabled = false; } // Not a boss wave else { WaveNameTitle.text = "NEW WAVE"; WaveNameDescription.text = waveInfo.Name; _TimerOnScreen = 0f; _OnScreen = true; gameObject.SetActive(true); WaveNameDescription.enabled = true; } } }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> // /// </summary> /// <returns> // IEnumerator /// </returns> private IEnumerator WaitForWidgetAvailiablity(WaveManager.WaveInfo waveInfo) { yield return(new WaitUntil(() => !WaveManager.Instance.WaveCompleteWidget.gameObject.activeInHierarchy)); // Play new wave starting sound SoundManager.Instance.PlaySound("SFX/_SFX_WaveStart", 1f, 1f); SoundManager.Instance.GetAnnouncer().PlayNewWaveSound(); if (WaveNameDescription != null) { // Next wave is a boss wave - only show title text if (_BossWave) { WaveNameTitle.text = "BOSS WAVE"; _TimerOnScreen = 0f; _OnScreen = true; WaveNameDescription.enabled = false; } // Not a boss wave else { WaveNameTitle.text = "NEW WAVE"; WaveNameDescription.text = waveInfo.Name; _TimerOnScreen = 0f; _OnScreen = true; WaveNameDescription.enabled = true; } // Reset center message colours _FadeColour = Color.white; if (NewWaveTitle != null) { NewWaveTitle.color = _FadeColour; } if (WaveNameText != null) { WaveNameText.color = _FadeColour; } if (LineHorizontal != null) { LineHorizontal.color = _FadeColour; } _FadingIn = true; _FadeProgress = 1f; } }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> // Called whenever a new wave starts. Displays the wave name as a sub-heading in the center of the screen. /// </summary> public void NewWaveNotification(WaveManager.WaveInfo waveInfo) { gameObject.SetActive(true); StartCoroutine(WaitForWidgetAvailiablity(waveInfo)); }