Level Won UI appearing before all enemies dead
jlofgree opened this issue · 1 comments
jlofgree commented
I think WinLevel is called too early. The "Level Won" UI appears and in the background there's still enemies being spawned. Is there a way to delay the UI display until ALL enemies gone? I think it has to do with this code:
void Update()
{
if (waveIndex == waves.Length)
{
gameManager.WinLevel();
enabled = false;
}
}
I tried even adding to the array like this:
if (waveIndex == waves.Length + 1)
Didn't work.
Any ideas?
jlofgree commented
I added a wave for 2 types of enemies and so I fixed this with changing:
EnemiesAlive = wave.count + wave.count2;