spawn mechanics

This commit is contained in:
Sveske Juice 2024-04-21 14:28:25 +02:00
parent 77a3b7f3fc
commit 5ada6671a6
1 changed files with 3 additions and 1 deletions

View File

@ -44,6 +44,8 @@ public class EnemySpawnManager : MonoBehaviour
public void OnPlayButtonClicked()
{
if (GameManager.Instance.CurrentNumEnemies != 0) return;
HasStarted = true;
PopWave();
}
@ -58,7 +60,7 @@ public class EnemySpawnManager : MonoBehaviour
if (HasStarted && IsAutoPlaying)
time += Time.deltaTime;
if (waveQueue.Count > 0 && waveQueue.Peek().spawnTime < time)
if (waveQueue.Count > 0 && (GameManager.Instance.CurrentNumEnemies == 0 && IsAutoPlaying))
{
PopWave();
}