Num enemies now accurate

This commit is contained in:
BOT Alex 2024-04-21 14:05:58 +02:00
parent 1e0e7b39d9
commit e5da90700a
1 changed files with 5 additions and 6 deletions

View File

@ -55,15 +55,10 @@ public class EnemySpawnManager : MonoBehaviour
void Update()
{
if (waveQueue.Count <= 0)
{
return;
}
if (HasStarted && IsAutoPlaying)
time += Time.deltaTime;
if (waveQueue.Peek().spawnTime < time)
if (waveQueue.Count > 0 && waveQueue.Peek().spawnTime < time)
{
PopWave();
}
@ -81,6 +76,10 @@ public class EnemySpawnManager : MonoBehaviour
void PopWave()
{
if (waveQueue.Count <= 0)
return;
time = 0;
WaveNum++;