Hi there,
Im in the process of updating to unity 2022 and the latest version of entities. Feeling reasonably confident in that my mono code is working seemingly fine on the main scene and my fixed prefabs (weapons/ammo/engines etc.) generate nicely using the baker system in my entities subscene.
In my game, all the main ships are procedurally generated using a monobehaviour ‘builder’ code from a simple load file, this means that players can make their own ships and the script will generate how it behaves and add in the various components and generate the meshes. As this wasnt hugely FPS sensitive i dont intend on converting it to ecs. The dots/ecs part is when you go to actually play the game and thus i had a conversion script that converted it pretty well in v0.51.
I know how to go about creating a baker class for the ships, however im uncertain conceptually how to go about and structure things. My idea is the following.
- Initial State - Entity subscene is unloaded
- Ship Generations - Ships as GameObjects are generated in main scene.
2 ) Add baker mono - Ships have baker monobehaviour component added to them in the gameobject, still in the main scene. - Move ship models to subscene somehow
- Activate subscene somehow
Stage 3/4 essentially is transferring those models with all the baker classes added into my entities sub scene and enable the entities subscene which i dont know how to do. I havnt found anything obvious that tells me how to do this having had a quick look at forums and docs (apologies if this is clearly covered somewhere).
In editor mode, i can get it to work by dragging those ship models (with baker attached) into the entity subscene in play mode and it seems to convert it without issue. However im pretty sure that it wont work that way in an actual build (again correct me if im wrong, just my understanding of the documentation) and i dont know the code to do this programmatically anyway (ie. move a gameobject into a entity subscene).
Thanks for any help you can give me ![]()
(Ideal case - i would like the ships as prefabs as the game will have multiple instances of the same ship class, but thats not essential since my 0.51 runs really well anyway despite them not being prefabs. Pretty sure i cant do this)