Num enemies now accurate
This commit is contained in:
parent
1e0e7b39d9
commit
e5da90700a
|
@ -55,15 +55,10 @@ public class EnemySpawnManager : MonoBehaviour
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
if (waveQueue.Count <= 0)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (HasStarted && IsAutoPlaying)
|
if (HasStarted && IsAutoPlaying)
|
||||||
time += Time.deltaTime;
|
time += Time.deltaTime;
|
||||||
|
|
||||||
if (waveQueue.Peek().spawnTime < time)
|
if (waveQueue.Count > 0 && waveQueue.Peek().spawnTime < time)
|
||||||
{
|
{
|
||||||
PopWave();
|
PopWave();
|
||||||
}
|
}
|
||||||
|
@ -81,6 +76,10 @@ public class EnemySpawnManager : MonoBehaviour
|
||||||
|
|
||||||
void PopWave()
|
void PopWave()
|
||||||
{
|
{
|
||||||
|
if (waveQueue.Count <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
time = 0;
|
time = 0;
|
||||||
WaveNum++;
|
WaveNum++;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue