Adding treat eating cooldown

This commit is contained in:
hz
2026-01-31 19:44:21 -06:00
parent e4e385c5c2
commit 14ec7e81b2
5 changed files with 93 additions and 38 deletions
+6 -2
View File
@@ -10,6 +10,7 @@ public class Spawner : MonoBehaviour
public float spawnInterval = 1f;
[SerializeField] private int maxAlive = 0;
[SerializeField] private bool spawnOnStart = true;
[SerializeField] private bool repeatSpawns = true;
private readonly List<GameObject> spawned = new List<GameObject>();
@@ -23,8 +24,11 @@ public class Spawner : MonoBehaviour
void Start()
{
// Start the spawning process using a Coroutine
StartCoroutine(SpawnRoutine());
if (repeatSpawns)
{
// Start the spawning process using a Coroutine
StartCoroutine(SpawnRoutine());
}
}
private IEnumerator SpawnRoutine()