Пример #1
0
    private IEnumerator SpawnNextWave()
    {
        AudioController.Instance.FadeOutLoop(0.6f);

        yield return(new WaitForSeconds(breakTimes / 4));

        string loopToPlay = string.IsNullOrEmpty(CurrentWave.songLoop) ? defaultWaveLoop : CurrentWave.songLoop;

        AudioController.Instance.SetLoop(loopToPlay);
        AudioController.Instance.SetLoopVolume(0.0f);
        AudioController.Instance.FadeInLoop(0.6f, 0.8f);

        yield return(new WaitForSeconds(breakTimes - breakTimes / 4));

        stage.WaveStarted(waveIndex);

        LerpAlpha textAplha = notifyText.GetComponent <LerpAlpha>();

        notifyText.text = "Wave " + (waveIndex + 1);
        notifyText.transform.SetAsLastSibling();
        textAplha.SetAlpha(0.0f);
        textAplha.IntendedAlpha = 0.8f;
        CustomCoroutine.WaitThenExecute(1.54f, () => {
            textAplha.IntendedAlpha = 0.0f;
        });

        foreach (var spawnGroup in CurrentWave.spawnGroups)
        {
            StartCoroutine(SpawnGroup(spawnGroup));
        }
    }
Пример #2
0
 private void Awake()
 {
     _lerpAlpha = GetComponent <LerpAlpha>();
     _particles = GetComponentInChildren <ParticleSystem>();
 }
 private void Awake()
 {
     _player     = Camera.main.transform;
     _fadeEffect = GetComponent <LerpAlpha>();
 }