Example #1
0
 private IEnumerator SpawnAllEnemiesInWave(WaveConfig waveConfig)
 {
     for (int enemyCount = 0; enemyCount < waveConfig.GetNumberOfEnemies(); enemyCount++)
     {
         var newEnemy = Instantiate(waveConfig.GetEnemyPrefab(), transform.position, Quaternion.identity);
         newEnemy.GetComponent <EnemyPathing>().SetWaveConfig(waveConfig);
         yield return(new WaitForSeconds(waveConfig.GEtTimeBetweenSpawns()));
     }
 }