public static void InitializeOnLoad() { if (!subscribedToEditorEvents) { EditorSceneManager.sceneOpened += EditorSceneManagerSceneOpened; EditorSceneManager.sceneClosed += EditorSceneManagerSceneClosed; subscribedToEditorEvents = true; } SearchForAndEnableExistingPlayspace(EditorSceneUtils.GetRootGameObjectsInLoadedScenes()); }
private static void EditorSceneManagerSceneClosed(Scene scene) { if (Application.isPlaying) { // Let the runtime scene management handle this return; } if (mixedRealityPlayspace == null) { // If we unloaded our playspace, see if another one exists SearchForAndEnableExistingPlayspace(EditorSceneUtils.GetRootGameObjectsInLoadedScenes()); } }
private static void EditorSceneManagerSceneOpened(Scene scene, OpenSceneMode mode) { if (Application.isPlaying) { // Let the runtime scene management handle this return; } if (mixedRealityPlayspace == null) { SearchForAndEnableExistingPlayspace(EditorSceneUtils.GetRootGameObjectsInLoadedScenes()); } else { SearchForAndDisableExtraPlayspaces(scene.GetRootGameObjects()); } }