Loop all enemy

hey every one , i have wrote the Code of looping the enemy and when the last wave ends , this message appears in unity and the loop stopped , i cheched the Z parameter of enemy but all are zeros.
can i have an answer , thanks.

edit [ i found the error ;
i set waveIndex less than or equal so i should add waveconfigs.Count-1
for (int waveIndex =startingWave; waveIndex =< waveconfigs.Count-1 ; waveIndex++)
{
var currentWave= waveconfigs[waveIndex];
yield return StartCoroutine(StartAllEnemiesInWave(currentWave));
}

loop

Privacy & Terms