Hi,
I found few threads about it, but answers were various and depended on specific cases, I couldn’t find definitive answer, so I will ask in my exact matter.
What’s the most efficient way to spawn lots of enemies (10 - 15, 2d game, rig animated sprites) , mainly of the same type on mobile devices. I actually suffer a lot from heavy plugin i am forced to use in this project, and i heard a lot how heavy Instantiate method is. Is there any better way to spawn enemies? Possible ideas:
- Simply Instantate, and Destroy objects.
- Create array of GameObjects, Place them somewhere in scene, and active/deactive when not used
- Put objects somewhere outisde the camera view, and then change their position when needed, use them on scene, change position back outside of camera and pause movement.
Another question:
If i place 15 same prefabs on scene, and simply pause them, will they generate only one draw call? Will all added components be same heavy as when they animate, and transform?
Components on enemies: Sprite Renderer, 2D Box Collider, Animator + Rig Animations, Rigibody 2D (for physic driven deaths), Scripts.
Or maybe there is general answer for this type of question and i just couldn’t find it?
Thanks in advance for all your answers.