Ejemplo n.º 1
0
        void UndoCallback()
        {
            // Undo-redo might change the layer order, so we need to redraw the compositor UI and also refresh the layer setup
            if (!m_Editor)
            {
                return;
            }

            m_Editor.CacheSerializedObjects();
            m_RequiresRedraw = true;

            // After undo, set the selection index to the last shown layer, because the Unity Editor resets the value to the last layer in the list
            m_Editor.defaultSelection = s_SelectionIndex;
            m_Editor.selectionIndex   = s_SelectionIndex;


            CompositionManager compositor = CompositionManager.GetInstance();

            // The compositor might be null even if the CompositionManagerEditor is not (in case the user switches from a scene with a compositor to a scene without one)
            if (compositor)
            {
                // Some properties were changed, mark the profile as dirty so it can be saved if the user saves the scene
                EditorUtility.SetDirty(compositor);
                EditorUtility.SetDirty(compositor.profile);

                // Clean-up existing cameras after undo, we will re-allocate the layer resources
                CompositorCameraRegistry.GetInstance().CleanUpCameraOrphans(compositor.layers);
                compositor.DeleteLayerRTs();
                compositor.UpdateLayerSetup();
            }
        }
Ejemplo n.º 2
0
        void UndoCallback()
        {
            // Undo-redo might change the layer order, so we need to redraw the compositor UI and also refresh the layer setup
            m_Editor.CacheSerializedObjects();
            m_RequiresRedraw = true;
            s_SelectionIndex = m_Editor.selectionIndex;

            CompositionManager compositor = CompositionManager.GetInstance();
            {
                // Some properties were changed, mark the profile as dirty so it can be saved if the user saves the scene
                EditorUtility.SetDirty(compositor);
                EditorUtility.SetDirty(compositor.profile);
                compositor.UpdateLayerSetup();
            }
        }
Ejemplo n.º 3
0
        void UndoCallback()
        {
            // Undo-redo might change the layer order, so we need to redraw the compositor UI and also refresh the layer setup
            if (!m_Editor)
            {
                return;
            }

            m_Editor.CacheSerializedObjects();
            m_RequiresRedraw = true;
            s_SelectionIndex = m_Editor.selectionIndex;

            CompositionManager compositor = CompositionManager.GetInstance();

            // The compositor might be null even if the CompositionManagerEditor is not (in case the user switches from a scene with a compositor to a scene without one)
            if (compositor)
            {
                // Some properties were changed, mark the profile as dirty so it can be saved if the user saves the scene
                EditorUtility.SetDirty(compositor);
                EditorUtility.SetDirty(compositor.profile);
                compositor.UpdateLayerSetup();
            }
        }