Grouping Enemies/Targets

I am working on a few survival mode missions with waves of enemies and I can’t figure out how to group enemies in order to know when the first wave is dead&gone and the next should pop up. Any ideas? Links? Thanks in advance!

per wave of enemies create an array of gameObjects: var currentWave : GameObject. Make it the length of the number of enemies in the wave and add all the newly instantiated enemies of that wave into the array. When an enemy is destroyed it’s corresponding element in the array will turn to null. When all the entries are null you know every creature in the wave is destroyed.

Alternatively use JS arrays, but they are a lot less fast when you use them a lot. See what works best for you. Read up on arrays here.