void LoadConfigScene() { // TODO: Emscripten seems to have problems loading statics so reading // from ConfigurationScene.Guid will pretty reliably come back as all zeros var configGuid = new Hash128("46b433b264c69cbd39f04ad2e5d12be8"); // ConfigurationScene.Guid; m_ConfigScene = m_SceneSystem.LoadSceneAsync(configGuid, new SceneSystem.LoadParameters() { AutoLoad = true, Flags = SceneLoadFlags.LoadAdditive }); m_CatalogOp = IOService.RequestAsyncRead(SceneSystem.GetSceneInfoPath()); }
internal static void FinalizeGameObjectSceneEntity(EntityManager entityManager, Entity sceneEntity, Scene gameObjectScene, SceneSystem sceneSystem) { // Create handle for ref counting unsafe { var gameObjectSceneReference = new GameObjectSceneData { Scene = gameObjectScene, gameObjectSceneHandle = GameObjectSceneRefCount.CreateOrRetainScene(gameObjectScene), }; entityManager.AddSharedComponentData(sceneEntity, gameObjectSceneReference); } #if UNITY_EDITOR entityManager.SetName(sceneEntity, $"GameObject Scene: {gameObjectScene.name}"); #endif var subSceneDataEnum = GetSubScenes(gameObjectScene); entityManager.AddBuffer <GameObjectSceneSubScene>(sceneEntity); while (subSceneDataEnum.MoveNext()) { var subSceneData = subSceneDataEnum.Current; var subSceneLoadParameters = new SceneSystem.LoadParameters { AutoLoad = subSceneData.AutoLoad }; var subSceneEntity = sceneSystem.GetSceneEntity(subSceneData.SceneGUID); if (subSceneEntity == Entity.Null) { subSceneEntity = sceneSystem.LoadSceneAsync(subSceneData.SceneGUID, subSceneLoadParameters); } var subSceneBuffer = entityManager.GetBuffer <GameObjectSceneSubScene>(sceneEntity); subSceneBuffer.Add(new GameObjectSceneSubScene { SceneEntity = subSceneEntity, }); } }