Hello,
I've got an array set up for my spawned enemies. When the game is not running the inspector shows this:
When the game runs, the component changes to show this (below) where there is now a Max Rows slider, set to 10:
In the game, if it's all kicking off, numerous waves of enemies can spawn, totaling more than 10, here you can see the contents is a 32:
When you shoot/destroy an enemy, it is removed from the array list, and the remaining objects (prefabs) on the list are sent various events depending on other variables. So, the array list is basically a list of 'alive' enemies.
The problem is, if the number of enemies has been quite high, like 32 in this this case; after you have destroyed them all in the game, there are still some left on the array list. Surely, if there are no enemies alive the array should be empty.
This screen grab shows the array list has a content value of 8, but in fact, there were no enemies alive at this time.
Do I need to somehow extend, or +1 at each enemy spawn, to the number of max rows? Or maybe there's something I'm missing?
Thanks in advance for any help.