Is there some way to spawn complex prefabs during conversion? From my understanding to spawn entities correctly so that the conversion system knows about them is to use
conversionSystem.CreateAdditionalEntity().
But I also want that entity to have all the converted components from a prefab with a complex hierarchy (using IDeclareReferencedPrefabs), when trying to copy over the components I only found EntityManager.CopyEntities but that does not copy over LinkedEntityGroup which kind of defeats the purpose of using a prefab. Do I have to implement this myself (and if yes how?) or is there some method that I am missing?
Create Game Object prefab, with its hierarchy.
Use Game Object to Entity Conversion workflow.
That will create entity prefab with all relevant hierarchy.
Now you can instantiate that entity prefab, many times as much you like.
Yes that is exactly what I am doing already, sorry if I was not clear enough :). My question was if it is possible to instantiate the prefab then during a conversion? My understanding from reading this Conversion Workflow | Entities | 0.17.0-preview.42 is that using Instantiate during the conversion will lead to incorrect incremental conversion.
What I do in such cases, I create prefabs through conversion.
Then I use component tag, to run initialize system, which does any additional modifications and create other prefabs, derived from main prefab. As an example.
That’s good advice right there!
Have we today any good approach to doing this only during conversion? Initialize systems is good, but able to spawn prefabs as additional entities seems pretty basic thing.
On Entities 1.0.13 or above somehow above that version, Baker has option for creating entities:
method CreateAdditionalEntity
As I can see CreateAdditionalEntity only accepts 3 parameters and no gameobject, so this method just creates empty entity.
any ideas?