Hi!
I am trying to load SubScene using the code below
protected async Task PrepareScene()
{
SubScene[] subScenes = FindObjectsByType<SubScene>(FindObjectsInactive.Include, FindObjectsSortMode.None);
await Msg($"subScenes:{subScenes.Length}");
SceneSystem.LoadParameters loadParameters = new() { Flags = SceneLoadFlags.BlockOnStreamIn };
for (int i = 0; i < subScenes.Length; i++)
{
Entity sceneEntity = SceneSystem.LoadSceneAsync(SideWorld.Unmanaged,
new Entities.Hash128(subScenes[i].SceneGUID.Value), loadParameters);
while (!SceneSystem.IsSceneLoaded(SideWorld.Unmanaged, sceneEntity))
{
await Msg($"Loading...:{i} [{subScenes[i].SceneName}]");
SideWorld.Update();
await Awaitable.NextFrameAsync();
}
await Msg($"Loaded:{i} [{subScenes[i].SceneName}]");
}
}
But despite the messages about the loaded scene, the scene is still marked as not loaded in the Entity inspector, besides, its contents are not rendered in the camera view:
Does anyone have any ideas?
Thanks!
UPD 7:58
We managed to solve this by uploading the scene to both ServerWorld and Client World, although in the Entity inspector the NewSubScene is still displayed as not loaded in both worlds. I know I’m doing something weird, but does anyone have any ideas on how to do it right? Thanks!