There seems to me to be two ways of adding components to entities:
-
One is shown in this tutorial, where components are added by using an [GenerateAuthoringComponent] attribute on a IComponentData added to a monobehaviour.
-
Not shown is another, where components are added using an entitymanager after the prefab has been converted to an entity and instantiated.
I am working on a project where I will spawn and destroy a large number of entities (apprx 1 to 5 per second, each having a large pathbuffer pushing the size restrictions for each entity), and I try to eke out all the performance benefits I can from DOTS. Is your system of instantiation more performant?
Also (a bit above and beyond this lesson in particular) is there a benefit to pooling entities rather than destroying them like there is for prefabs?
Cheers,