I have a 2d game with a few Empty GameObjects, all called “Spawner”. They are tagged with “Spawner” as well. When 10 of such enemies are killed, I summon a boss.
if (enemiesKilled == 10) {
enemiesKilled = 11;
bossOne.SetActive(true);
}
However, there is a second boss summoned once 20 are defeated:
if (enemiesKilled == 20) {
enemiesKilled = 21;
bossTwo.SetActive(true);
}
The spawners still instantiate enemies while fighting the first boss, so the second boss can spawn while fighting the first. How can I disable all the spawners? I have seen other solutions but they do not seem to work for me. Thank you.