예제 #1
0
    private IEnumerator SpawnAllEnemiesInWave(WaveConfig waveConfig)
    {
        for (int enemyCount = 0; enemyCount < waveConfig.GetNumberOfEnemies(); enemyCount++)
        {
            if (waveConfig.GetIsDoubleWave())
            {
                CreateEnemy(waveConfig, waveConfig.GetWaypoints());
                CreateEnemy(waveConfig, waveConfig.GetWaypointsFromPath2());
            }
            else
            {
                CreateEnemy(waveConfig, waveConfig.GetWaypoints());
            }


            yield return(new WaitForSeconds(waveConfig.GetTimeBetweenSpawns()));
        }
        yield return(new WaitForSeconds(waveConfig.GetTimeForNextWave()));
    }