- Home /
Question by
Parthon · Mar 03, 2011 at 04:17 PM ·
gameobjectlistdestroy
What happens to GameObjects in a List when Destroy()'d elsewhere?
I want to have a List of currently spawned enemies, and when one gets destroyed, spawn one to replace it after a delay.
If I Destroy() the enemy when it's hit, would it disappear from or turn to null within that List or would I have to set a flag and later remove and destroy the enemy from the list manager?
Or could I use a 'dial home' message that alerts the list manager when one is blown up?
Comment
Best Answer
Answer by Mike 3 · Mar 03, 2011 at 04:24 PM
It'll go null (in that weird way unity objects do due to operator overloading)
You should be able to go through and check for items that are == null
Fantastic. This is exactly what I was after. Thanks mike! :D