This seems like an embarrasingly basic question, yet I can’t seem to find an answer for it in any documentation or thread.
Conversion systems and automatic conversion via IConvertGameObjectToEntity seem to only run when the program starts.
(I know that EntityManager.CreateEntity can be used to manually create entities anytime, but you can’t use this to create an entity from a prefab.)
GameObjectConversionUtility seems like it works right now but I’ve read that it is supposed to be deprecated; therefore, there must be another canonical way to do this, right?
Edit: example use case: I’d like to have a spawner entity, containing a component that references an entity prefab, and instantiate that prefab periodically.
Im on my phone at the moment so I don’t have the links readily available. Yes, you can create from prefabs is the short answer.
Unity has an entities repository on Github with examples. One of which is exactly spawn from prefab.
As a test, (tgis used to work) make a new file /struct implementing IComponent Data, make a pu lic field Entity, then add the attribute to the struct GenerateAuthoringComponent
In Unity, a new component should be available whose field is a GameObject. That, again used to, concert to an entity. Though I’d still recommend the github
Get in line I have more embarrassing DOTS questions than you! But seriously, DOTS is really bleeding edge so no questions are bad questions. The answers are super varied at times though.