spawn waves of enemies unity3d] code example
Example: unity spawn enemy waves
IEnumerator SpawnWave() { //Debug.Log("Wave Incoming"); Wave wave = waves[waveIndex]; //EnemyBlueprint eb = enemies[enemyIndex]; for (int a = 0; a < wave.waveCount; a++) { yield return new WaitForSeconds(1f / wave.waveRate); for (int i = 0; i < enemies.enemyCount; i++) { SpawnEnemy(enemies.enemy); yield return new WaitForSeconds(1f / enemies.enemyRate); } } waveIndex++; PlayerStats.Rounds++; if (waveIndex == waves.Length) { Debug.Log("LEVEL WON!"); this.enabled = false; } }