private IEnumerator SpawnWaveCoroutine(EnemyAgent enemyPrefab, int enemies, float enemySpawnDelay) { for (int i = 0; i < enemies; i++) { yield return(new WaitForSeconds(enemySpawnDelay)); SpawnEnemy(enemyPrefab, path); } }
private void SpawnEnemy(EnemyAgent enemyPrefab, Transform path) { var enemy = enemyPool.Spawn(enemyPrefab, path.position, Quaternion.identity); enemy.LoadWaypoints(path); }
public void SpawnWave(EnemyAgent enemyPrefab, int enemies, float enemySpawnDelay) { StartCoroutine(SpawnWaveCoroutine(enemyPrefab, enemies, enemySpawnDelay)); }