#Using the Baking System from Scripts

1 messages · Page 1 of 1 (latest)

hazy reef
#

Back with the conversion workflow, as well as being available at runtime, it was available as an API. We were using this because it meant we could avoid SubScenes (which cause issues for us as they affect all worlds, even without auto load). The new baking system appears to be internal. Are there plans for stabilising it and making it public?

At the moment, we're invoking it with reflection, which is far from ideal.

rose path
#

There are no plans to make this public. I also would caution you against using reflection to do this, as we could easily break your workflow with future updates. We have no intention of returning to supporting runtime 'conversion'.

hazy reef
#

Unfortunately, since we can't use SubScenes we're somewhat "damned if you do, damned if you don't". We could copy the entire baking system into our own project and modify it accordingly but I suspect that would be equally fragile, so I don't think we have any way to progress here short of writing our own entire authoring flow. (This is fairly well tied to the other thread about having multiple worlds.)

If I understand the situation correctly:

  • We can't get entity scenes to build without having the scene which contains the SubScene in the build settings (which we want to avoid for our server builds)
  • We can't generate entity scenes ourselves since the APIs are internal
  • We can't use SubScenes without them affecting other parts of our system
  • We could load them quite happily with the scene system if we got to that point
rose path
#

We can't get entity scenes to build without having the scene which contains the SubScene in the build settings (which we want to avoid for our server builds)
It just needs to be in any scene, actually. You could just have a dummy scene with the SubScenes you want to end up in your build. In 1.0 there are some improvements to this with our content management system. Keep in mind that the resulting Entity Scene is the same if a SubScene is in two different scenes, but points to the same Unity Scene asset.

We can't generate entity scenes ourselves since the APIs are internal
That's probably correct, yes.

We can't use SubScenes without them affecting other parts of our system
Why is this?

hazy reef
rose path
#

That's just the SubScene MonoBehaviour itself, which of course is not ideal. You can load the Entity Scene directly with the SceneSystem in a specific World.

hazy reef
#

So, if I understand correctly, we could:

  • Have our main scene (which is loaded by the client, full of regular game objects)
  • An authoring scene with just the subscene game object (which is only loaded in the editor but in the build list)
  • The subscene scene which actually has the entities for conversion in
    If so, that's pretty helpful. 😅