This question was
closed Jul 27, 2018 at 09:52 PM by
aolba for the following reason:
Lack of interest from the community
Question by
aolba · Jul 27, 2018 at 03:54 PM ·
destroygameobjectprocess
Destroy/Purge GameObjects in Parent Empty Object
Part of my Class code manage to create a GameObject, attach a SpriteRenderer and finally set all this as a child of the main Parent. This will be run for 400 or 500 times. So I don't want to have that much of items in my editor. I have the idea of remove all those dynamic GameObjects at some point, but I get some errors or the destroy order is just ignored. I try with OnApplicationQuit and OnDIsable. I see some idea of store the GameObjects in an array and read that array for the destruction process, but then I see this comment "... you should never iterate through arrays and destroy the elements you are iterating over..." So I run out of ideas.
Comment