- We create our custom world.
- Then we add some systems and also ConverToEntitySystem under InitializationSystemGroup.
- And we finally set created world as World.DefaultGameObjectInjectionWorld.
I tryed different order variations of this steps but conversion doesn’t work. Gameobject with ConvertToEntity mono just stay in scene and no entity appears. Maybe i just missing something simple. How to get conversion work with custom world?
UPD: It’s possible to manualy GetComponents from gameobject and call Convert(entity, entityManager, null) and conversion works.
Solved: ConvertToEntity runs in Awake() method, so your world creation must be before any ConvertToEntity awake call. There is 2 possible solutions is see. First is use InitializeOnLoadMethodAttribute. Second is edit Script Execution Order Settings and place your world creation to negative index (assuming that your logic runs in awake phase).