Exemplo n.º 1
0
    private IEnumerator SpawnAllWaves()
    {
        foreach (WaveConfig wave in waves)
        {
            currentWave = wave;

            if (wave.IsSeparated())
            {
                StartCoroutine(SpawnAllEnemiesInWave(currentWave));
                do
                {
                    yield return(null);
                }while (AreEnemiesLeft());
            }
            else
            {
                StartCoroutine(SpawnAllEnemiesInWave(currentWave));
                yield return(new WaitForSeconds(defaultTimeBetweenWaves + currentWave.GetMercyTime()));
            }

            ResetSpawnedEnemiesCounter();
        }
    }