I can’t find the way how to do that
I think you must use subscenes and bakers(use bakers for example to convert prefabs to entity and then instantiate that prefab-entity later from the code) to convert GameObject to Entity here is tutorial : https://github.com/Unity-Technologies/EntityComponentSystemSamples/tree/master/DOTS_Guide - go ecs tutorial - i think there is no other way to convert except this one (basically other ways which means converting outside of subscene like in 0.51 ConvertToEntity tricks are not supported any more).
Look at episode 4 (second half) and 5 of my dots training (link in my signature).
It will take you through the migration of a simple project in 0.51 to 1.0 and explain the baking workflow.
Right, it turned out that a game object must be placed on the subscene Thank you
I’m completely stuck with this. What is the workflow if I need to load GameObjects as prefabs programmatically? How do I add them onto SubScene? Should I add a SubScene into every level scene or I can just create one programmatically once level scene loaded? Ideal would to be add SubScene programmatically and then add/convert GameObjects from prefabs to it. But I can not find the way to do it.
If I add GameObjects with Mono and Bakers into SubScene in Scene Editor - it works just fine. But I need to be able to add lots of prefabs on every level scene once loaded. Thanks for any advice.
I have a partial solution - it “works”, but only if the mesh is on the root gameobject of the prefab.
This is really a deal breaker. How do you use Entities with asset bundles?
I’m using Entities but not the Graphics package. Putting a GameObject with a Mesh/Material into a SubScene causes it to disappear. That’s just unacceptable for the project I’m working on. I need something like Convert To Entity. I tried creating my own with a custom authoring script in MonoBehaviour but as soon as the entity is created and the GameObject is destroyed it throws an error saying the EntityManager has been destroyed.
I also hate how they’ve removed the Asset Menu to automatically create Components/Authoring/System scripts. It’s also very buggy when using Unity in a 2D project. Not very much liking Entities 1.0 so far. Keep going back to 0.51.
Adding back the asset menu to create dots related script is relatively easy.
I’ve put mine on GitHub so feel free to use them.
https://github.com/WAYN-Games/DOTS-Script-Templates
If you are not using the graphics API you will have to use the hybrid approach.
I did a video that cover how to use it for animated character.
https://www.youtube.com/watch?v=vs6h4waQpPA
If you are using only this approach you may even be able to improve on it and not have to rely on a prefab which would make the authoring experience better.
I’m using Graphics.DrawMeshInstanced. I use GameObjects so that I have a visual representation of what I’m working with in scene view then the GameObjects are destroyed (Convert to Entity as I’m currently using 0.51) and everything is rendered using Graphics.DrawMeshInstanced, inside a SystemBase, exactly as they are seen in the scene view.
Seems in order to do anything remotely similar in 1.0 you have to do a lot of hacky stuff.