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());
            }
        }
Пример #3
0
        /// <summary>
        ///     Override this method to make your own GUI for the property
        /// </summary>
        /// <param name="position">Position</param>
        /// <param name="prop">Property</param>
        /// <param name="label">Label</param>
        public override void OnGUI(Rect position, SerializedProperty prop, GUIContent label)
        {
            label = EditorGUI.BeginProperty(position, label, prop);

            FindProperties(prop);

            HydraEditorUtils.SceneField(position, label, m_GuidProp, HydraEditorGUIStyles.enumStyle);

            string path = AssetDatabase.GUIDToAssetPath(m_GuidProp.stringValue);

            m_NameProp.stringValue = string.IsNullOrEmpty(path) ? string.Empty : EditorSceneUtils.GetSceneName(path);
            m_IndexProp.intValue   = string.IsNullOrEmpty(path) ? 0 : EditorSceneUtils.GetSceneIndex(path);

            EditorGUI.EndProperty();
        }
        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());
            }
        }
Пример #5
0
        /// <summary>
        /// Adds all scenes from profile into build settings.
        /// </summary>
        private void EditorUpdateBuildSettings()
        {
            if (!profile.EditorManageBuildSettings)
            {   // Nothing to do here
                return;
            }

            if (profile.UseManagerScene)
            {
                if (EditorSceneUtils.AddSceneToBuildSettings(
                        profile.ManagerScene,
                        cachedBuildScenes,
                        EditorSceneUtils.BuildIndexTarget.First))
                {
                    cachedBuildScenes = EditorBuildSettings.scenes;
                }
            }

            foreach (SceneInfo contentScene in profile.ContentScenes)
            {
                if (EditorSceneUtils.AddSceneToBuildSettings(
                        contentScene,
                        cachedBuildScenes,
                        EditorSceneUtils.BuildIndexTarget.None))
                {
                    cachedBuildScenes = EditorBuildSettings.scenes;
                }
            }

            if (profile.UseLightingScene)
            {
                foreach (SceneInfo lightingScene in profile.LightingScenes)
                {   // Make sure ALL lighting scenes are added to build settings
                    if (EditorSceneUtils.AddSceneToBuildSettings(
                            lightingScene,
                            cachedBuildScenes,
                            EditorSceneUtils.BuildIndexTarget.Last))
                    {
                        cachedBuildScenes = EditorBuildSettings.scenes;
                    }
                }
            }

            EditorCheckForSceneNameDuplicates();
        }
Пример #6
0
        /// <summary>
        /// Ensures that if a content scene is loaded, that scene is set active, rather than a lighting or manager scene.
        /// </summary>
        private void EditorUpdateContentScenes(bool activeSceneDirty)
        {
            if (!profile.UseLightingScene || !profile.EditorManageLoadedScenes)
            {   // Nothing to do here
                return;
            }

            if (!activeSceneDirty)
            {   // Nothing to do here either
                return;
            }

            bool      contentSceneIsActive    = false;
            SceneInfo firstLoadedContentScene = SceneInfo.Empty;

            foreach (SceneInfo contentScene in profile.ContentScenes)
            {
                Scene scene;
                if (EditorSceneUtils.GetSceneIfLoaded(contentScene, out scene))
                {
                    if (firstLoadedContentScene.IsEmpty)
                    {   // If this is the first loaded content scene we've found, store it for later
                        firstLoadedContentScene = contentScene;
                    }

                    Scene activeScene = EditorSceneManager.GetActiveScene();
                    if (activeScene.name == contentScene.Name)
                    {
                        contentSceneIsActive = true;
                    }
                }
            }

            if (!firstLoadedContentScene.IsEmpty)
            {     // If at least one content scene is loaded
                if (!contentSceneIsActive)
                { // And that content scene is NOT the active scene
                    // Set that content to be the active scene
                    Scene activeScene;
                    EditorSceneUtils.GetSceneIfLoaded(firstLoadedContentScene, out activeScene);
                    EditorSceneUtils.SetActiveScene(activeScene);
                }
            }
        }
Пример #7
0
        /// <summary>
        /// Ensures that there are no scenes in build settings with duplicate names.
        /// If any are found, a resolve duplicates window is launched.
        /// </summary>
        private void EditorCheckForSceneNameDuplicates()
        {
            List <SceneInfo> allScenes = new List <SceneInfo>();
            Dictionary <string, List <int> > duplicates = new Dictionary <string, List <int> >();

            foreach (SceneInfo sceneInfo in profile.LightingScenes)
            {
                if (!sceneInfo.IsEmpty)
                {   // Don't bother with empty scenes, they'll be handled elsewhere.
                    allScenes.Add(sceneInfo);
                }
            }

            foreach (SceneInfo sceneInfo in profile.ContentScenes)
            {
                if (!sceneInfo.IsEmpty)
                {   // Don't bother with empty scenes, they'll be handled elsewhere.
                    allScenes.Add(sceneInfo);
                }
            }

            if (profile.UseManagerScene && !profile.ManagerScene.IsEmpty)
            {
                allScenes.Add(profile.ManagerScene);
            }

            if (EditorSceneUtils.CheckBuildSettingsForDuplicates(allScenes, duplicates))
            {
                // If it's already open, don't display
                if (!ResolveDuplicateScenesWindow.IsOpen)
                {
                    ResolveDuplicateScenesWindow window = EditorWindow.GetWindow <ResolveDuplicateScenesWindow>("Fix Duplicate Scene Names");
                    window.ResolveDuplicates(duplicates, allScenes);
                }
            }
            else if (ResolveDuplicateScenesWindow.IsOpen)
            {
                // If we fixed the issue without the window, close the window
                ResolveDuplicateScenesWindow.Instance.Close();
            }
        }
Пример #8
0
        /// <summary>
        /// If a lighting scene is being used, this ensures that at least one lighting scene is loaded in editor.
        /// </summary>
        private void EditorUpdateLightingScene(bool heirarchyDirty)
        {
            if (!profile.UseLightingScene || !profile.EditorManageLoadedScenes)
            {
                return;
            }

            if (string.IsNullOrEmpty(ActiveLightingScene))
            {
                ActiveLightingScene = profile.DefaultLightingScene.Name;
            }
            else
            {
                foreach (SceneInfo lightingScene in profile.LightingScenes)
                {
                    if (lightingScene.Name == ActiveLightingScene)
                    {
                        Scene scene;
                        if (EditorSceneUtils.LoadScene(lightingScene, false, out scene))
                        {
                            EditorSceneUtils.CopyLightingSettingsToActiveScene(scene);

                            if (profile.EditorEnforceLightingSceneTypes && heirarchyDirty)
                            {
                                EditorEnforceLightingSceneTypes(scene);
                            }
                        }

                        if (profile.EditorEnforceSceneOrder)
                        {   // If we're enforcing scene order, make sure this scene comes after the current scene
                            Scene currentFirstScene = EditorSceneManager.GetSceneAt(0);
                            EditorSceneManager.MoveSceneAfter(scene, currentFirstScene);
                        }
                    }
                    else
                    {
                        EditorSceneUtils.UnloadScene(lightingScene, true);
                    }
                }
            }
        }
Пример #9
0
        /// <summary>
        /// Singly loads next content scene (if available) and unloads all other content scenes.
        /// Useful for inspectors.
        /// </summary>
        public void EditorLoadNextContent(bool wrap = false)
        {
            string contentSceneName;

            if (contentTracker.GetNextContent(wrap, out contentSceneName))
            {
                foreach (SceneInfo contentScene in ContentScenes)
                {
                    if (contentScene.Name == contentSceneName)
                    {
                        EditorSceneUtils.LoadScene(contentScene, false, out Scene scene);
                    }
                    else
                    {
                        EditorSceneUtils.UnloadScene(contentScene, false);
                    }
                }
            }

            contentTracker.RefreshLoadedContent();
        }
        public override void OnInspectorGUI()
        {
            if (!MixedRealityToolkit.IsInitialized)
            {
                return;
            }

            RenderProfileHeader(ProfileTitle, ProfileDescription, target);

            MixedRealityInspectorUtility.CheckMixedRealityConfigured(true);

            serializedObject.Update();

            MixedRealitySceneSystemProfile profile = (MixedRealitySceneSystemProfile)target;

            RenderFoldout(ref showEditorProperties, "Editor Settings", () =>
            {
                using (new EditorGUI.IndentLevelScope())
                {
                    EditorGUILayout.PropertyField(editorManageBuildSettings);
                    EditorGUILayout.PropertyField(editorManageLoadedScenes);
                    EditorGUILayout.PropertyField(editorEnforceSceneOrder);
                    EditorGUILayout.PropertyField(editorEnforceLightingSceneTypes);

                    if (editorEnforceLightingSceneTypes.boolValue)
                    {
                        EditorGUILayout.Space();
                        EditorGUILayout.HelpBox("Below are the component types that will be allowed in lighting scenes. Types not found in this list will be moved to another scene.", MessageType.Info);
                        EditorGUIUtility.labelWidth = LightingSceneTypesLabelWidth;
                        EditorGUILayout.PropertyField(permittedLightingSceneComponentTypes, true);
                        EditorGUIUtility.labelWidth = 0;
                    }
                }
            }, ShowSceneSystem_Editor_PreferenceKey);

            RenderFoldout(ref showManagerProperties, "Manager Scene Settings", () =>
            {
                using (new EditorGUI.IndentLevelScope())
                {
                    EditorGUILayout.HelpBox(managerSceneContent, MessageType.Info);

                    // Disable the tag field since we're drawing manager scenes
                    SceneInfoDrawer.DrawTagProperty = false;
                    EditorGUILayout.PropertyField(useManagerScene);

                    if (useManagerScene.boolValue && profile.ManagerScene.IsEmpty && !Application.isPlaying)
                    {
                        EditorGUILayout.HelpBox("You haven't created a manager scene yet. Click the button below to create one.", MessageType.Warning);
                        var buttonRect = EditorGUI.IndentedRect(EditorGUILayout.GetControlRect(new GUILayoutOption[] { }));
                        if (GUI.Button(buttonRect, "Create Manager Scene", EditorStyles.miniButton))
                        {
                            // Create a new manager scene and add it to build settings
                            SceneInfo newManagerScene = EditorSceneUtils.CreateAndSaveScene("ManagerScene");
                            SerializedObjectUtils.SetStructValue <SceneInfo>(managerScene, newManagerScene);
                            EditorSceneUtils.AddSceneToBuildSettings(newManagerScene, EditorBuildSettings.scenes, EditorSceneUtils.BuildIndexTarget.First);
                        }
                        EditorGUILayout.Space();
                    }

                    if (useManagerScene.boolValue)
                    {
                        EditorGUILayout.PropertyField(managerScene, includeChildren: true);
                    }
                }
            }, ShowSceneSystem_Manager_PreferenceKey);

            RenderFoldout(ref showLightingProperties, "Lighting Scene Settings", () =>
            {
                using (new EditorGUI.IndentLevelScope())
                {
                    EditorGUILayout.HelpBox(lightingSceneContent, MessageType.Info);

                    EditorGUILayout.PropertyField(useLightingScene);

                    if (useLightingScene.boolValue && profile.NumLightingScenes < 1 && !Application.isPlaying)
                    {
                        EditorGUILayout.HelpBox("You haven't created a lighting scene yet. Click the button below to create one.", MessageType.Warning);
                        var buttonRect = EditorGUI.IndentedRect(EditorGUILayout.GetControlRect(new GUILayoutOption[] { }));
                        if (GUI.Button(buttonRect, "Create Lighting Scene", EditorStyles.miniButton))
                        {
                            // Create a new lighting scene and add it to build settings
                            SceneInfo newLightingScene = EditorSceneUtils.CreateAndSaveScene("LightingScene");
                            // Create an element in the array
                            lightingScenes.arraySize = 1;
                            serializedObject.ApplyModifiedProperties();
                            SerializedObjectUtils.SetStructValue <SceneInfo>(lightingScenes.GetArrayElementAtIndex(0), newLightingScene);
                            EditorSceneUtils.AddSceneToBuildSettings(newLightingScene, EditorBuildSettings.scenes, EditorSceneUtils.BuildIndexTarget.Last);
                        }
                        EditorGUILayout.Space();
                    }

                    if (useLightingScene.boolValue)
                    {
                        // Disable the tag field since we're drawing lighting scenes
                        SceneInfoDrawer.DrawTagProperty = false;

                        if (profile.NumLightingScenes > 0)
                        {
                            string[] lightingSceneNames        = profile.LightingScenes.Select(l => l.Name).ToArray <string>();
                            defaultLightingSceneIndex.intValue = EditorGUILayout.Popup("Default Lighting Scene", defaultLightingSceneIndex.intValue, lightingSceneNames);
                        }

                        EditorGUILayout.PropertyField(lightingScenes, includeChildren: true);
                        //DrawSceneInfoDragAndDrop(lightingScenes);

                        EditorGUILayout.Space();

                        if (profile.NumLightingScenes > 0)
                        {
                            if (profile.EditorLightingCacheOutOfDate)
                            {
                                EditorGUILayout.HelpBox("Your cached lighting settings may be out of date. This could result in unexpected appearances at runtime.", MessageType.Warning);
                            }
                            if (InspectorUIUtility.RenderIndentedButton(new GUIContent("Update Cached Lighting Settings"), EditorStyles.miniButton))
                            {
                                profile.EditorLightingCacheUpdateRequested = true;
                            }
                        }
                        EditorGUILayout.Space();
                    }
                }
            }, ShowSceneSystem_Lighting_PreferenceKey);

            RenderFoldout(ref showContentProperties, "Content Scene Settings", () =>
            {
                using (new EditorGUI.IndentLevelScope())
                {
                    EditorGUILayout.HelpBox(contentSceneContent, MessageType.Info);

                    // Enable the tag field since we're drawing content scenes
                    SceneInfoDrawer.DrawTagProperty = true;
                    EditorGUILayout.PropertyField(contentScenes, includeChildren: true);
                    //DrawSceneInfoDragAndDrop(contentScenes);
                }
            }, ShowSceneSystem_Content_PreferenceKey);

            serializedObject.ApplyModifiedProperties();

            // Keep this inspector perpetually refreshed
            EditorUtility.SetDirty(target);
        }
Пример #11
0
        /// <summary>
        /// Ensures that only approved component types are present in lighting scenes.
        /// </summary>
        private void EditorEnforceLightingSceneTypes(Scene scene)
        {
            if (EditorSceneManager.sceneCount == 1)
            {   // There's nowhere to move invalid objects to.
                return;
            }

            List <Component> violations = new List <Component>();

            if (EditorSceneUtils.EnforceSceneComponents(scene, profile.PermittedLightingSceneComponentTypes, violations))
            {
                Scene targetScene = default(Scene);
                for (int i = 0; i < EditorSceneManager.sceneCount; i++)
                {
                    targetScene = EditorSceneManager.GetSceneAt(i);
                    if (targetScene.path != scene.path)
                    {   // We'll move invalid items to this scene
                        break;
                    }
                }

                if (!targetScene.IsValid() || !targetScene.isLoaded)
                {   // Something's gone wrong - don't proceed
                    return;
                }

                HashSet <Transform> rootObjectsToMove = new HashSet <Transform>();
                foreach (Component component in violations)
                {
                    rootObjectsToMove.Add(component.transform.root);
                }

                List <string> rootObjectNames = new List <string>();
                // Build a list of root objects so they know what's being moved
                foreach (Transform rootObject in rootObjectsToMove)
                {
                    rootObjectNames.Add(rootObject.name);
                }

                EditorUtility.DisplayDialog(
                    "Invalid components found in " + scene.name,
                    "Only lighting-related components are permitted. The following GameObjects will be moved to another scene:\n\n"
                    + String.Join("\n", rootObjectNames)
                    + "\n\nTo disable this warning, un-check 'EditorEnforceLightingSceneTypes' in your SceneSystem profile.", "OK");

                try
                {
                    foreach (Transform rootObject in rootObjectsToMove)
                    {
                        EditorSceneManager.MoveGameObjectToScene(rootObject.gameObject, targetScene);
                    }

                    EditorGUIUtility.PingObject(rootObjectsToMove.FirstOrDefault());
                }
                catch (Exception)
                {
                    // This can happen if the move object operation fails. No big deal, we'll try again next time.
                    return;
                }
            }
        }
Пример #12
0
        /// <summary>
        /// If a manager scene is being used, this loads the scene in editor and ensures that an instance of the MRTK has been added to it.
        /// </summary>
        private void EditorUpdateManagerScene()
        {
            if (!profile.UseManagerScene || !profile.EditorManageLoadedScenes)
            {   // Nothing to do here.
                return;
            }

            if (EditorSceneUtils.LoadScene(profile.ManagerScene, true, out Scene scene))
            {
                // If we're managing scene hierarchy, move this to the front
                if (profile.EditorEnforceSceneOrder)
                {
                    Scene currentFirstScene = EditorSceneManager.GetSceneAt(0);
                    if (currentFirstScene.name != scene.name)
                    {
                        EditorSceneManager.MoveSceneBefore(scene, currentFirstScene);
                    }
                }

                if (Time.realtimeSinceStartup > managerSceneInstanceCheckTime)
                {
                    managerSceneInstanceCheckTime = Time.realtimeSinceStartup + managerSceneInstanceCheckInterval;
                    // Check for an MRTK instance
                    bool foundToolkitInstance = false;

                    try
                    {
                        foreach (GameObject rootGameObject in scene.GetRootGameObjects())
                        {
                            MixedRealityToolkit instance = rootGameObject.GetComponent <MixedRealityToolkit>();
                            if (instance != null)
                            {
                                foundToolkitInstance = true;
                                // If we found an instance, and it's not the active instance, we probably want to activate it
                                if (instance != MixedRealityToolkit.Instance)
                                {   // The only exception would be if the new instance has a different profile than the current instance
                                    // If that's the case, we could end up ping-ponging between two sets of manager scenes
                                    if (!instance.HasActiveProfile)
                                    {   // If it doesn't have a profile, set it to our current profile
                                        instance.ActiveProfile = MixedRealityToolkit.Instance.ActiveProfile;
                                    }
                                    else if (instance.ActiveProfile != MixedRealityToolkit.Instance.ActiveProfile)
                                    {
                                        Debug.LogWarning("The active profile of the instance in your manager scene is different from the profile that loaded your scene. This is not recommended.");
                                    }
                                    else
                                    {
                                        Debug.LogWarning("Setting the manager scene MixedRealityToolkit instance to the active instance.");
                                        MixedRealityToolkit.SetActiveInstance(instance);
                                    }
                                }
                                break;
                            }
                        }
                    }
                    catch (Exception)
                    {
                        // This can happen if the scene isn't valid
                        // Not an issue - we'll take care of it on the next update.
                        return;
                    }

                    if (!foundToolkitInstance)
                    {
                        GameObject          mrtkGo          = new GameObject("MixedRealityToolkit");
                        MixedRealityToolkit toolkitInstance = mrtkGo.AddComponent <MixedRealityToolkit>();

                        try
                        {
                            SceneManager.MoveGameObjectToScene(mrtkGo, scene);
                            // Set the scene as dirty
                            EditorSceneManager.MarkSceneDirty(scene);
                        }
                        catch (Exception)
                        {
                            // This can happen if the scene isn't valid
                            // Not an issue - we'll take care of it on the next update.
                            // Destroy the new manager
                            GameObject.DestroyImmediate(mrtkGo);
                            return;
                        }

                        MixedRealityToolkit.SetActiveInstance(toolkitInstance);
                        Debug.LogWarning("Didn't find a MixedRealityToolkit instance in your manager scene. Creating one now.");
                    }
                }
            }
            else
            {
                Debug.Log("Couldn't load manager scene!");
            }
        }
Пример #13
0
        /// <summary>
        /// Loads all lighting scenes, extracts their lighting data, then caches that data in the profile.
        /// </summary>
        private async Task EditorUpdateCachedLighting()
        {
            // Clear out our lighting cache
            profile.ClearLightingCache();
            profile.EditorLightingCacheUpdateRequested = false;

            SceneInfo defaultLightingScene = profile.DefaultLightingScene;

            foreach (SceneInfo lightingScene in profile.LightingScenes)
            {
                // Load all our lighting scenes
                Scene scene;
                EditorSceneUtils.LoadScene(lightingScene, false, out scene);
            }

            // Wait for a moment so all loaded scenes have time to get set up
            await Task.Delay(100);

            foreach (SceneInfo lightingScene in profile.LightingScenes)
            {
                Scene scene;
                EditorSceneUtils.GetSceneIfLoaded(lightingScene, out scene);
                EditorSceneUtils.SetActiveScene(scene);

                SerializedObject lightingSettingsObject;
                SerializedObject renderSettingsObject;
                EditorSceneUtils.GetLightingAndRenderSettings(out lightingSettingsObject, out renderSettingsObject);

                // Copy the serialized objects into new structs
                RuntimeLightingSettings lightingSettings = default(RuntimeLightingSettings);
                RuntimeRenderSettings   renderSettings   = default(RuntimeRenderSettings);
                RuntimeSunlightSettings sunlightSettings = default(RuntimeSunlightSettings);

                lightingSettings = SerializedObjectUtils.CopySerializedObjectToStruct <RuntimeLightingSettings>(lightingSettingsObject, lightingSettings, "m_");
                renderSettings   = SerializedObjectUtils.CopySerializedObjectToStruct <RuntimeRenderSettings>(renderSettingsObject, renderSettings, "m_");

                // Extract sunlight settings based on sunlight object
                SerializedProperty sunProperty = renderSettingsObject.FindProperty("m_Sun");
                if (sunProperty == null)
                {
                    Debug.LogError("Sun settings may not be available in this version of Unity.");
                }
                else
                {
                    Light sunLight = (Light)sunProperty.objectReferenceValue;

                    if (sunLight != null)
                    {
                        sunlightSettings.UseSunlight = true;
                        sunlightSettings.Color       = sunLight.color;
                        sunlightSettings.Intensity   = sunLight.intensity;

                        Vector3 eulerAngles = sunLight.transform.eulerAngles;
                        sunlightSettings.XRotation = eulerAngles.x;
                        sunlightSettings.YRotation = eulerAngles.y;
                        sunlightSettings.ZRotation = eulerAngles.z;
                    }
                }

                profile.SetLightingCache(lightingScene, lightingSettings, renderSettings, sunlightSettings);
            }
        }
Пример #14
0
        /// <summary>
        /// Checks the state of service and profile based on changes made in editor and reacts accordingly.
        /// </summary>
        private async void EditorCheckForChanges()
        {
            if (!MixedRealityToolkit.IsInitialized || !MixedRealityToolkit.Instance.HasActiveProfile || !MixedRealityToolkit.Instance.ActiveProfile.IsSceneSystemEnabled)
            {
                return;
            }

            if (EditorSceneUtils.IsEditingPrefab())
            {   // Never change scene settings while editing a prefab - it will boot you out of the prefab scene stage.
                return;
            }

            if (updatingSettingsOnEditorChanged || EditorApplication.isPlayingOrWillChangePlaymode || EditorApplication.isCompiling)
            {   // Make sure we don't double up on our updates via events we trigger during updates
                return;
            }

            if (updatingCachedLightingSettings)
            {   // This is a long operation, don't interrupt it
                return;
            }

            // Update cached lighting settings, if the profile has requested it
            if (profile.EditorLightingCacheUpdateRequested)
            {
                updatingCachedLightingSettings  = true;
                updatingSettingsOnEditorChanged = true;

                await EditorUpdateCachedLighting();

                updatingSettingsOnEditorChanged = false;
                updatingCachedLightingSettings  = false;
                // This is an async operation which may take a while to execute
                // So exit when we're done - we'll pick up where we left off next time
                heirarchyDirty = true;
                return;
            }

            updatingSettingsOnEditorChanged = true;

            // Update editor settings

            if (FileModificationWarning.ModifiedAssetPaths.Count > 0)
            {
                EditorCheckIfCachedLightingOutOfDate();
                FileModificationWarning.ModifiedAssetPaths.Clear();
            }

            if (buildSettingsDirty)
            {
                buildSettingsDirty = false;

                EditorUpdateBuildSettings();
            }

            if (activeSceneDirty || heirarchyDirty)
            {
                heirarchyDirty   = false;
                activeSceneDirty = false;

                EditorUpdateManagerScene();
                EditorUpdateLightingScene(heirarchyDirty);
                EditorUpdateContentScenes(activeSceneDirty);

                contentTracker.RefreshLoadedContent();
            }

            EditorUtility.SetDirty(profile);

            updatingSettingsOnEditorChanged = false;
        }