Num enemies now accurate
This commit is contained in:
parent
1e0e7b39d9
commit
e5da90700a
|
@ -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++;
|
||||
|
||||
|
|
Loading…
Reference in New Issue