I have a question regarding the ECS/DOTS setup. Whenever I've seen examples of Baking it only is about 1 gameobject being turned into an entity and the components that come with it in one sample scene. But in a real world example, I can't seem to really find what the best practice is. Is the best practice to have multiple Sub Scenes in different parent scenes, one for each Gameobject you need to Bake, or is the idea that you have many sub scenes within the same parent scene?
It's not clear from the documentation I've looked through so far.
#Best Practices for SubScenes?
1 messages · Page 1 of 1 (latest)
In my own setup I wish to have:
- Many different turrets that shoot bullets with travel time
- Many different units that all move towards a central point (let's call those units Monsters)
So given the above:
- In an example like that, would I need to make a Scene per Monster/Turret I want to make, with a SubScene in each for baking?
- Or would I instead make a parent scene with lots of SubScenes in it to do all the baking?
- Do I simply make a config object and populate it with Prefabs that I then turn into Entities without making SubScenes for each?
I can't really find out how a real world example would work for baking many different types of data structures like this.
you can have many GOs inside subscene so it's possible to bake everything you need with only one subscene in project
So if I wanted a bunch of different monster gameobjects for example, having each separate GO in one big subscene would be the way to go?
you can bake some kind of library for your prefabs to reference them easy later
so it will be one object with many referenced gameobjects
when you need to spawn something you will get it as singleton and instantiate prefab from it's field
that works, but workflow gets worse and worse
because subscene bake time increases
you probably should use EntityPrefabReference
it's a loose reference to entity prefab which can be loaded async
in runtime
as well as unloaded
I see. I haven't looked at any samples yet that does this. Do you know if there is one from unity?