Exemplo n.º 1
0
        static InfluenceVolumeUI()
        {
            Color[] shapeHandlesColor = new[]
            {
                k_GizmoThemeColorBase,
                k_GizmoThemeColorBase,
                k_GizmoThemeColorBase,
                k_GizmoThemeColorBase,
                k_GizmoThemeColorBase,
                k_GizmoThemeColorBase
            };

            //important: hierarchical box must be created here or the skin colors
            //may not be fully charged and handles could be drawn in black
            s_BoxBaseHandle = new HierarchicalBox(
                k_GizmoThemeColorBase,
                shapeHandlesColor);
            s_BoxInfluenceHandle = new HierarchicalBox(
                k_GizmoThemeColorInfluence,
                k_HandlesColor,
                parent: s_BoxBaseHandle);
            s_BoxInfluenceNormalHandle = new HierarchicalBox(
                k_GizmoThemeColorInfluenceNormal,
                k_HandlesColor,
                parent: s_BoxBaseHandle);

            s_SphereBaseHandle      = new HierarchicalSphere(k_GizmoThemeColorBase);
            s_SphereInfluenceHandle = new HierarchicalSphere(
                k_GizmoThemeColorInfluence,
                parent: s_SphereBaseHandle);
            s_SphereInfluenceNormalHandle = new HierarchicalSphere(
                k_GizmoThemeColorInfluenceNormal,
                parent: s_SphereBaseHandle);
        }
        void OnSceneGUI()
        {
            DensityVolume   densityVolume = target as DensityVolume;
            HierarchicalBox shapeBox      = shapeBoxes[densityVolume];
            HierarchicalBox blendBox      = blendBoxes[densityVolume];

            using (new Handles.DrawingScope(Matrix4x4.TRS(densityVolume.transform.position, densityVolume.transform.rotation, Vector3.one)))
            {
                if (EditMode.editMode == k_EditBlend || EditMode.editMode == k_EditShape)
                {
                    //contained must be initialized in all case
                    shapeBox.center = Vector3.zero;
                    shapeBox.size   = densityVolume.parameters.size;
                }

                if (EditMode.editMode == k_EditBlend)
                {
                    blendBox.monoHandle = !densityVolume.parameters.advancedFade;
                    blendBox.center     = CenterBlendLocalPosition(densityVolume);
                    blendBox.size       = BlendSize(densityVolume);
                    EditorGUI.BeginChangeCheck();
                    blendBox.DrawHandle();
                    if (EditorGUI.EndChangeCheck())
                    {
                        Undo.RecordObject(densityVolume, "Change Density Volume Blend");

                        //work in local space to compute the change on positiveFade and negativeFade
                        Vector3 newCenterBlendLocalPosition = blendBox.center;
                        Vector3 halfSize = blendBox.size * 0.5f;
                        Vector3 size     = densityVolume.parameters.size;
                        Vector3 posFade  = newCenterBlendLocalPosition + halfSize;
                        posFade.x = 0.5f - posFade.x / size.x;
                        posFade.y = 0.5f - posFade.y / size.y;
                        posFade.z = 0.5f - posFade.z / size.z;
                        Vector3 negFade = newCenterBlendLocalPosition - halfSize;
                        negFade.x = 0.5f + negFade.x / size.x;
                        negFade.y = 0.5f + negFade.y / size.y;
                        negFade.z = 0.5f + negFade.z / size.z;
                        densityVolume.parameters.positiveFade = posFade;
                        densityVolume.parameters.negativeFade = negFade;
                    }
                }

                if (EditMode.editMode == k_EditShape)
                {
                    shapeBox.monoHandle = !densityVolume.parameters.advancedFade;
                    EditorGUI.BeginChangeCheck();
                    shapeBox.DrawHandle();
                    if (EditorGUI.EndChangeCheck())
                    {
                        Undo.RecordObjects(new Object[] { densityVolume, densityVolume.transform }, "ChangeDensity Volume Bounding Box");
                        densityVolume.transform.position += densityVolume.transform.rotation * shapeBox.center;
                        densityVolume.parameters.size     = shapeBox.size;
                    }
                }
            }
        }
Exemplo n.º 3
0
        protected void OnEnable()
        {
            m_SerializedProbeVolume = new SerializedProbeVolume(serializedObject);

            shapeBoxes.Clear();
            for (int i = 0; i < targets.Length; ++i)
            {
                var shapeBox = shapeBoxes[targets[i] as ProbeVolume] = new HierarchicalBox(ProbeVolumeUI.Styles.k_GizmoColorBase, ProbeVolumeUI.Styles.k_BaseHandlesColor);
                shapeBox.monoHandle = false;
            }
        }
        void OnEnable()
        {
            m_SerializedLocalVolumetricFog = new SerializedLocalVolumetricFog(serializedObject);

            if (s_ShapeBox == null || s_ShapeBox.Equals(null))
            {
                s_ShapeBox            = new HierarchicalBox(LocalVolumetricFogUI.Styles.k_GizmoColorBase, LocalVolumetricFogUI.Styles.k_BaseHandlesColor);
                s_ShapeBox.monoHandle = false;
            }
            if (s_BlendBox == null || s_BlendBox.Equals(null))
            {
                s_BlendBox = new HierarchicalBox(LocalVolumetricFogUI.Styles.k_GizmoColorBase, InfluenceVolumeUI.k_HandlesColor, parent: s_ShapeBox);
            }
        }
        void OnEnable()
        {
            volumeFalloffSerialized = new VolumeFalloffSerialized(serializedObject);
            var volumeFalloff = target as VolumeFalloff;

            if (s_ShapeBox == null || s_ShapeBox.Equals(null))
            {
                s_ShapeBox            = new HierarchicalBox(volumeFalloff.debugColor, null);
                s_ShapeBox.monoHandle = false;
            }
            if (s_BlendBox == null || s_BlendBox.Equals(null))
            {
                s_BlendBox = new HierarchicalBox(volumeFalloff.debugColor, null, parent: s_ShapeBox);
            }
        }
Exemplo n.º 6
0
        void OnEnable()
        {
            m_SerializedDensityVolume = new SerializedDensityVolume(serializedObject);

            shapeBoxes.Clear();
            blendBoxes.Clear();
            int max = Mathf.Min(targets.Length, k_MaxDisplayedBox);

            for (int i = 0; i < max; ++i)
            {
                var shapeBox = shapeBoxes[targets[i] as DensityVolume] = new HierarchicalBox(DensityVolumeUI.Styles.k_GizmoColorBase, DensityVolumeUI.Styles.k_BaseHandlesColor);
                shapeBox.monoHandle = false;
                blendBoxes[targets[i] as DensityVolume] = new HierarchicalBox(DensityVolumeUI.Styles.k_GizmoColorBase, InfluenceVolumeUI.k_HandlesColor, parent: shapeBox);
            }
        }
        void OnEnable()
        {
            m_SerializedData = new SerializedReflectionProxyVolumeComponent(serializedObject);
            System.Array.Resize(ref m_TypedTargets, serializedObject.targetObjects.Length);
            for (int i = 0; i < serializedObject.targetObjects.Length; ++i)
            {
                m_TypedTargets[i] = (ReflectionProxyVolumeComponent)serializedObject.targetObjects[i];
            }

            m_SphereHandle = new HierarchicalSphere(k_HandleColor);
            m_BoxHandle    = new HierarchicalBox(k_HandleColor, new[] { k_HandleColor, k_HandleColor, k_HandleColor, k_HandleColor, k_HandleColor, k_HandleColor })
            {
                monoHandle = false
            };
        }
        static void DrawGizmosSelected(DensityVolume densityVolume, GizmoType gizmoType)
        {
            using (new Handles.DrawingScope(Matrix4x4.TRS(densityVolume.transform.position, densityVolume.transform.rotation, Vector3.one)))
            {
                // Blend box
                HierarchicalBox blendBox = blendBoxes[densityVolume];
                blendBox.center = CenterBlendLocalPosition(densityVolume);
                blendBox.size   = BlendSize(densityVolume);
                Color baseColor = densityVolume.parameters.albedo;
                baseColor.a        = 8 / 255f;
                blendBox.baseColor = baseColor;
                blendBox.DrawHull(EditMode.editMode == k_EditBlend);

                // Bounding box.
                HierarchicalBox shapeBox = shapeBoxes[densityVolume];
                shapeBox.center = Vector3.zero;
                shapeBox.size   = densityVolume.parameters.size;
                shapeBox.DrawHull(EditMode.editMode == k_EditShape);
            }
        }
        public InfluenceVolumeUI()
            : base(k_ShapeCount + k_AnimBoolFields)
        {
            isSectionExpandedShape.value = true;

            Color baseHandle = InfluenceVolumeUI.k_GizmoThemeColorBase;

            baseHandle.a = 1f;
            Color[] basehandleColors = new Color[]
            {
                baseHandle, baseHandle, baseHandle,
                baseHandle, baseHandle, baseHandle
            };
            boxBaseHandle            = new HierarchicalBox(InfluenceVolumeUI.k_GizmoThemeColorBase, basehandleColors);
            boxBaseHandle.monoHandle = false;
            boxInfluenceHandle       = new HierarchicalBox(InfluenceVolumeUI.k_GizmoThemeColorInfluence, k_HandlesColor, container: boxBaseHandle);
            boxInfluenceNormalHandle = new HierarchicalBox(InfluenceVolumeUI.k_GizmoThemeColorInfluenceNormal, k_HandlesColor, container: boxBaseHandle);

            sphereBaseHandle            = new HierarchicalSphere(InfluenceVolumeUI.k_GizmoThemeColorBase);
            sphereInfluenceHandle       = new HierarchicalSphere(InfluenceVolumeUI.k_GizmoThemeColorInfluence, container: sphereBaseHandle);
            sphereInfluenceNormalHandle = new HierarchicalSphere(InfluenceVolumeUI.k_GizmoThemeColorInfluenceNormal, container: sphereBaseHandle);
        }
        void OnEnable()
        {
            densityParams = serializedObject.FindProperty("parameters");

            albedo       = densityParams.FindPropertyRelative("albedo");
            meanFreePath = densityParams.FindPropertyRelative("meanFreePath");

            volumeTexture = densityParams.FindPropertyRelative("volumeMask");
            textureScroll = densityParams.FindPropertyRelative("textureScrollingSpeed");
            textureTile   = densityParams.FindPropertyRelative("textureTiling");

            size = densityParams.FindPropertyRelative("size");

            positiveFade = densityParams.FindPropertyRelative("m_PositiveFade");
            negativeFade = densityParams.FindPropertyRelative("m_NegativeFade");
            uniformFade  = densityParams.FindPropertyRelative("m_UniformFade");
            advancedFade = densityParams.FindPropertyRelative("advancedFade");
            invertFade   = densityParams.FindPropertyRelative("invertFade");

            shapeBoxes.Clear();
            blendBoxes.Clear();
            int max = Mathf.Min(targets.Length, k_MaxDisplayedBox);

            for (int i = 0; i < max; ++i)
            {
                var shapeBox = shapeBoxes[targets[i] as DensityVolume] = new HierarchicalBox(Styles.k_GizmoColorBase, Styles.k_BaseHandlesColor);
                shapeBox.monoHandle = false;
                blendBoxes[targets[i] as DensityVolume] = new HierarchicalBox(Styles.k_GizmoColorBase, InfluenceVolumeUI.k_HandlesColor, container: shapeBox);
            }

            //init save of state if first time
            if (!EditorPrefs.HasKey(k_StateKey))
            {
                EditorPrefs.SetInt(k_StateKey, (int)(Expendable.Volume | Expendable.DensityMaskTexture));
            }
        }
        static void DrawBoxHandle(InfluenceVolumeUI s, SerializedInfluenceVolume d, Editor o, Object sourceAsset, HierarchicalBox box)
        {
            box.center = d.offset.vector3Value;
            box.size   = d.boxSize.vector3Value;

            EditorGUI.BeginChangeCheck();
            box.DrawHandle();
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(sourceAsset, "Modified Base Volume AABB");

                d.offset.vector3Value = box.center;

                Vector3 blendPositive       = d.boxBlendDistancePositive.vector3Value;
                Vector3 blendNegative       = d.boxBlendDistanceNegative.vector3Value;
                Vector3 blendNormalPositive = d.boxBlendNormalDistancePositive.vector3Value;
                Vector3 blendNormalNegative = d.boxBlendNormalDistanceNegative.vector3Value;
                Vector3 size = box.size;
                d.boxSize.vector3Value = size;
                Vector3 halfSize = size * .5f;
                for (int i = 0; i < 3; ++i)
                {
                    blendPositive[i]       = Mathf.Clamp(blendPositive[i], 0f, halfSize[i]);
                    blendNegative[i]       = Mathf.Clamp(blendNegative[i], 0f, halfSize[i]);
                    blendNormalPositive[i] = Mathf.Clamp(blendNormalPositive[i], 0f, halfSize[i]);
                    blendNormalNegative[i] = Mathf.Clamp(blendNormalNegative[i], 0f, halfSize[i]);
                }
                d.boxBlendDistancePositive.vector3Value       = blendPositive;
                d.boxBlendDistanceNegative.vector3Value       = blendNegative;
                d.boxBlendNormalDistancePositive.vector3Value = blendNormalPositive;
                d.boxBlendNormalDistanceNegative.vector3Value = blendNormalNegative;

                if (d.editorAdvancedModeEnabled.boolValue)
                {
                    d.editorAdvancedModeBlendDistancePositive.vector3Value       = d.boxBlendDistancePositive.vector3Value;
                    d.editorAdvancedModeBlendDistanceNegative.vector3Value       = d.boxBlendDistanceNegative.vector3Value;
                    d.editorAdvancedModeBlendNormalDistancePositive.vector3Value = d.boxBlendNormalDistancePositive.vector3Value;
                    d.editorAdvancedModeBlendNormalDistanceNegative.vector3Value = d.boxBlendNormalDistanceNegative.vector3Value;
                }
                else
                {
                    d.editorSimplifiedModeBlendDistance.floatValue = Mathf.Min(
                        d.boxBlendDistancePositive.vector3Value.x,
                        d.boxBlendDistancePositive.vector3Value.y,
                        d.boxBlendDistancePositive.vector3Value.z,
                        d.boxBlendDistanceNegative.vector3Value.x,
                        d.boxBlendDistanceNegative.vector3Value.y,
                        d.boxBlendDistanceNegative.vector3Value.z);
                    d.boxBlendDistancePositive.vector3Value = d.boxBlendDistanceNegative.vector3Value = Vector3.one * d.editorSimplifiedModeBlendDistance.floatValue;
                    d.editorSimplifiedModeBlendNormalDistance.floatValue = Mathf.Min(
                        d.boxBlendNormalDistancePositive.vector3Value.x,
                        d.boxBlendNormalDistancePositive.vector3Value.y,
                        d.boxBlendNormalDistancePositive.vector3Value.z,
                        d.boxBlendNormalDistanceNegative.vector3Value.x,
                        d.boxBlendNormalDistanceNegative.vector3Value.y,
                        d.boxBlendNormalDistanceNegative.vector3Value.z);
                    d.boxBlendNormalDistancePositive.vector3Value = d.boxBlendNormalDistanceNegative.vector3Value = Vector3.one * d.editorSimplifiedModeBlendNormalDistance.floatValue;
                }

                d.Apply();
            }
        }
        static void DrawBoxFadeHandle(InfluenceVolumeUI s, SerializedInfluenceVolume d, Editor o, Object sourceAsset, HierarchicalBox box, SerializedProperty positive, SerializedProperty negative)
        {
            box.center     = d.offset.vector3Value - (positive.vector3Value - negative.vector3Value) * 0.5f;
            box.size       = d.boxSize.vector3Value - positive.vector3Value - negative.vector3Value;
            box.monoHandle = !d.editorAdvancedModeEnabled.boolValue;

            //set up parent box too for clamping
            s.boxBaseHandle.center = d.offset.vector3Value;
            s.boxBaseHandle.size   = d.boxSize.vector3Value;

            EditorGUI.BeginChangeCheck();
            box.DrawHandle();
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(sourceAsset, "Modified Influence Volume");

                var halfInfluenceSize     = d.boxSize.vector3Value * .5f;
                var blendDistancePositive = d.offset.vector3Value - box.center - box.size * .5f + halfInfluenceSize;
                var blendDistanceNegative = box.center - d.offset.vector3Value - box.size * .5f + halfInfluenceSize;

                positive.vector3Value = Vector3.Min(blendDistancePositive, halfInfluenceSize);
                negative.vector3Value = Vector3.Min(blendDistanceNegative, halfInfluenceSize);

                d.Apply();
            }
        }
Exemplo n.º 13
0
        static void DrawBoxFadeHandle(SerializedInfluenceVolume serialized, Editor owner, Transform transform, HierarchicalBox box, SerializedProperty positive, SerializedProperty negative)
        {
            using (new Handles.DrawingScope(Matrix4x4.TRS(transform.position, transform.rotation, Vector3.one)))
            {
                box.center     = -(positive.vector3Value - negative.vector3Value) * 0.5f;
                box.size       = serialized.boxSize.vector3Value - positive.vector3Value - negative.vector3Value;
                box.monoHandle = !serialized.editorAdvancedModeEnabled.boolValue;

                EditorGUI.BeginChangeCheck();
                box.DrawHandle();
                box.DrawHull(true);
                if (EditorGUI.EndChangeCheck())
                {
                    var influenceCenter   = Vector3.zero;
                    var halfInfluenceSize = serialized.boxSize.vector3Value * .5f;

                    var centerDiff            = box.center - influenceCenter;
                    var halfSizeDiff          = halfInfluenceSize - box.size * .5f;
                    var positiveNew           = halfSizeDiff - centerDiff;
                    var negativeNew           = halfSizeDiff + centerDiff;
                    var blendDistancePositive = Vector3.Max(Vector3.zero, Vector3.Min(positiveNew, halfInfluenceSize));
                    var blendDistanceNegative = Vector3.Max(Vector3.zero, Vector3.Min(negativeNew, halfInfluenceSize));

                    positive.vector3Value = blendDistancePositive;
                    negative.vector3Value = blendDistanceNegative;
                }
            }
        }
Exemplo n.º 14
0
        static void DrawBoxHandle(SerializedInfluenceVolume serialized, Editor owner, Transform transform, HierarchicalBox box)
        {
            using (new Handles.DrawingScope(Matrix4x4.TRS(Vector3.zero, transform.rotation, Vector3.one)))
            {
                box.center = Quaternion.Inverse(transform.rotation) * transform.position;
                box.size   = serialized.boxSize.vector3Value;

                EditorGUI.BeginChangeCheck();
                box.DrawHull(true);
                box.DrawHandle();
                if (EditorGUI.EndChangeCheck())
                {
                    var newPosition = transform.rotation * box.center;
                    Undo.RecordObject(transform, "Moving Influence");
                    transform.position = newPosition;

                    // Clamp blend distances
                    var blendPositive       = serialized.boxBlendDistancePositive.vector3Value;
                    var blendNegative       = serialized.boxBlendDistanceNegative.vector3Value;
                    var blendNormalPositive = serialized.boxBlendNormalDistancePositive.vector3Value;
                    var blendNormalNegative = serialized.boxBlendNormalDistanceNegative.vector3Value;
                    var size = box.size;
                    serialized.boxSize.vector3Value = size;
                    var halfSize = size * .5f;
                    for (int i = 0; i < 3; ++i)
                    {
                        blendPositive[i]       = Mathf.Clamp(blendPositive[i], 0f, halfSize[i]);
                        blendNegative[i]       = Mathf.Clamp(blendNegative[i], 0f, halfSize[i]);
                        blendNormalPositive[i] = Mathf.Clamp(blendNormalPositive[i], 0f, halfSize[i]);
                        blendNormalNegative[i] = Mathf.Clamp(blendNormalNegative[i], 0f, halfSize[i]);
                    }
                    serialized.boxBlendDistancePositive.vector3Value       = blendPositive;
                    serialized.boxBlendDistanceNegative.vector3Value       = blendNegative;
                    serialized.boxBlendNormalDistancePositive.vector3Value = blendNormalPositive;
                    serialized.boxBlendNormalDistanceNegative.vector3Value = blendNormalNegative;

                    if (serialized.editorAdvancedModeEnabled.boolValue)
                    {
                        serialized.editorAdvancedModeBlendDistancePositive.vector3Value       = serialized.boxBlendDistancePositive.vector3Value;
                        serialized.editorAdvancedModeBlendDistanceNegative.vector3Value       = serialized.boxBlendDistanceNegative.vector3Value;
                        serialized.editorAdvancedModeBlendNormalDistancePositive.vector3Value = serialized.boxBlendNormalDistancePositive.vector3Value;
                        serialized.editorAdvancedModeBlendNormalDistanceNegative.vector3Value = serialized.boxBlendNormalDistanceNegative.vector3Value;
                    }
                    else
                    {
                        serialized.editorSimplifiedModeBlendDistance.floatValue = Mathf.Min(
                            serialized.boxBlendDistancePositive.vector3Value.x,
                            serialized.boxBlendDistancePositive.vector3Value.y,
                            serialized.boxBlendDistancePositive.vector3Value.z,
                            serialized.boxBlendDistanceNegative.vector3Value.x,
                            serialized.boxBlendDistanceNegative.vector3Value.y,
                            serialized.boxBlendDistanceNegative.vector3Value.z);
                        serialized.boxBlendDistancePositive.vector3Value = serialized.boxBlendDistanceNegative.vector3Value = Vector3.one * serialized.editorSimplifiedModeBlendDistance.floatValue;
                        serialized.editorSimplifiedModeBlendNormalDistance.floatValue = Mathf.Min(
                            serialized.boxBlendNormalDistancePositive.vector3Value.x,
                            serialized.boxBlendNormalDistancePositive.vector3Value.y,
                            serialized.boxBlendNormalDistancePositive.vector3Value.z,
                            serialized.boxBlendNormalDistanceNegative.vector3Value.x,
                            serialized.boxBlendNormalDistanceNegative.vector3Value.y,
                            serialized.boxBlendNormalDistanceNegative.vector3Value.z);
                        serialized.boxBlendNormalDistancePositive.vector3Value = serialized.boxBlendNormalDistanceNegative.vector3Value = Vector3.one * serialized.editorSimplifiedModeBlendNormalDistance.floatValue;
                    }
                }
            }
        }
        void OnSceneGUI()
        {
            DensityVolume   densityVolume = target as DensityVolume;
            HierarchicalBox shapeBox      = shapeBoxes[densityVolume];
            HierarchicalBox blendBox      = blendBoxes[densityVolume];

            switch (EditMode.editMode)
            {
            case k_EditBlend:
                using (new Handles.DrawingScope(Matrix4x4.TRS(densityVolume.transform.position, densityVolume.transform.rotation, Vector3.one)))
                {
                    //contained must be initialized in all case
                    shapeBox.center = Vector3.zero;
                    shapeBox.size   = densityVolume.parameters.size;

                    blendBox.monoHandle = !densityVolume.parameters.advancedFade;
                    blendBox.center     = CenterBlendLocalPosition(densityVolume);
                    blendBox.size       = BlendSize(densityVolume);
                    EditorGUI.BeginChangeCheck();
                    blendBox.DrawHandle();
                    if (EditorGUI.EndChangeCheck())
                    {
                        Undo.RecordObject(densityVolume, "Change Density Volume Blend");

                        //work in local space to compute the change on positiveFade and negativeFade
                        Vector3 newCenterBlendLocalPosition = blendBox.center;
                        Vector3 halfSize = blendBox.size * 0.5f;
                        Vector3 size     = densityVolume.parameters.size;
                        Vector3 posFade  = newCenterBlendLocalPosition + halfSize;
                        posFade.x = 0.5f - posFade.x / size.x;
                        posFade.y = 0.5f - posFade.y / size.y;
                        posFade.z = 0.5f - posFade.z / size.z;
                        Vector3 negFade = newCenterBlendLocalPosition - halfSize;
                        negFade.x = 0.5f + negFade.x / size.x;
                        negFade.y = 0.5f + negFade.y / size.y;
                        negFade.z = 0.5f + negFade.z / size.z;
                        densityVolume.parameters.positiveFade = posFade;
                        densityVolume.parameters.negativeFade = negFade;
                    }
                }
                break;

            case k_EditShape:
                //important: if the origin of the handle's space move along the handle,
                //handles displacement will appears as moving two time faster.
                using (new Handles.DrawingScope(Matrix4x4.TRS(Vector3.zero, densityVolume.transform.rotation, Vector3.one)))
                {
                    //contained must be initialized in all case
                    shapeBox.center = Quaternion.Inverse(densityVolume.transform.rotation) * densityVolume.transform.position;
                    shapeBox.size   = densityVolume.parameters.size;

                    shapeBox.monoHandle = !densityVolume.parameters.advancedFade;
                    EditorGUI.BeginChangeCheck();
                    shapeBox.DrawHandle();
                    if (EditorGUI.EndChangeCheck())
                    {
                        Undo.RecordObjects(new Object[] { densityVolume, densityVolume.transform }, "ChangeDensity Volume Bounding Box");

                        densityVolume.parameters.size = shapeBox.size;

                        Vector3 delta = densityVolume.transform.rotation * shapeBox.center - densityVolume.transform.position;
                        densityVolume.transform.position += delta;;
                    }
                }
                break;
            }
        }