Esempio n. 1
0
 static void Drawer_ReflectionProbeMode(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
 {
     EditorGUI.BeginChangeCheck();
     EditorGUI.showMixedValue = p.mode.hasMultipleDifferentValues;
     EditorGUILayout.IntPopup(p.mode, k_Content_ReflectionProbeMode, k_Content_ReflectionProbeModeValues, CoreEditorUtils.GetContent("Type|'Baked Cubemap' uses the 'Auto Baking' mode from the Lighting window. If it is enabled then baking is automatic otherwise manual bake is needed (use the bake button below). \n'Custom' can be used if a custom cubemap is wanted. \n'Realtime' can be used to dynamically re-render the cubemap during runtime (via scripting)."));
     EditorGUI.showMixedValue = false;
     if (EditorGUI.EndChangeCheck())
     {
         s.SetModeTarget(p.mode.intValue);
         foreach (var targetObject in p.so.targetObjects)
         {
             HDReflectionProbeEditorUtility.ResetProbeSceneTextureInMaterial((ReflectionProbe)targetObject);
         }
     }
 }
 static void Drawer_InfluenceProxyMissmatch(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
 {
     if (p.proxyVolumeComponent.objectReferenceValue != null)
     {
         var proxy = (ReflectionProxyVolumeComponent)p.proxyVolumeComponent.objectReferenceValue;
         if ((int)proxy.proxyVolume.shapeType != p.influenceShape.enumValueIndex)
         {
             EditorGUILayout.HelpBox(
                 "Proxy volume and influence volume have different shape types, this is not supported.",
                 MessageType.Error,
                 true
                 );
         }
     }
 }
 static void Drawer_InfluenceShapeSphereSettings(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
 {
     EditorGUILayout.BeginHorizontal();
     EditorGUILayout.PropertyField(p.influenceSphereRadius, CoreEditorUtils.GetContent("Radius"));
     if (GUILayout.Button(toolbar_Contents[0], GUILayout.ExpandHeight(true), GUILayout.Width(28f), GUILayout.Height(EditorGUIUtility.singleLineHeight + 3)))
     {
         EditMode.ChangeEditMode(EditMode.SceneViewEditMode.ReflectionProbeBox, GetBoundsGetter(p)(), owner);
     }
     EditorGUILayout.EndHorizontal();
     EditorGUILayout.BeginHorizontal();
     EditorGUILayout.PropertyField(p.boxOffset, CoreEditorUtils.GetContent("Sphere Offset|The center of the sphere in which the reflections will be applied to objects. The value is relative to the position of the Game Object."));
     if (GUILayout.Button(toolbar_Contents[3], GUILayout.ExpandHeight(true), GUILayout.Width(28f), GUILayout.Height(EditorGUIUtility.singleLineHeight + 3)))
     {
         EditMode.ChangeEditMode(EditMode.SceneViewEditMode.ReflectionProbeOrigin, GetBoundsGetter(p)(), owner);
     }
     EditorGUILayout.EndHorizontal();
 }
        static void Drawer_AdditionalSettings(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
        {
            EditorGUILayout.PropertyField(p.dimmer);

            if (p.so.targetObjects.Length == 1)
            {
                var probe = p.target;
                if (probe.mode == ReflectionProbeMode.Custom && probe.customBakedTexture != null)
                {
                    var cubemap = probe.customBakedTexture as Cubemap;
                    if (cubemap && cubemap.mipmapCount == 1)
                    {
                        EditorGUILayout.HelpBox("No mipmaps in the cubemap, Smoothness value in Standard shader will be ignored.", MessageType.Warning);
                    }
                }
            }
        }
Esempio n. 5
0
        void OnSceneGUI()
        {
            var s = m_UIState;
            var p = m_SerializedHdReflectionProbe;
            var o = this;

            BakeRealtimeProbeIfPositionChanged(s, p, o);

            HDReflectionProbeUI.DoShortcutKey(p, o);

            if (!s.sceneViewEditing)
            {
                return;
            }

            EditorGUI.BeginChangeCheck();

            switch (EditMode.editMode)
            {
            // Influence editing
            case EditMode.SceneViewEditMode.ReflectionProbeBox:
                Handle_InfluenceEditing(s, p, o);
                break;

            // Influence fade editing
            case EditMode.SceneViewEditMode.GridBox:
                Handle_InfluenceFadeEditing(s, p, o, InfluenceType.Standard);
                break;

            // Influence normal fade editing
            case EditMode.SceneViewEditMode.Collider:
                Handle_InfluenceFadeEditing(s, p, o, InfluenceType.Normal);
                break;

            // Origin editing
            case EditMode.SceneViewEditMode.ReflectionProbeOrigin:
                Handle_OriginEditing(s, p, o);
                break;
            }

            if (EditorGUI.EndChangeCheck())
            {
                Repaint();
            }
        }
Esempio n. 6
0
        public override void OnInspectorGUI()
        {
            //InspectColorsGUI();

            var s = m_UIState;
            var p = m_SerializedHdReflectionProbe;

            s.Update();
            p.Update();

            HDReflectionProbeUI.Inspector.Draw(s, p, this);

            PerformOperations(s, p, this);

            p.Apply();

            HideAdditionalComponents(false);

            HDReflectionProbeUI.DoShortcutKey(p, this);
        }
        static void Drawer_InfluenceShape(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
        {
            EditorGUI.BeginChangeCheck();
            EditorGUI.showMixedValue = p.influenceShape.hasMultipleDifferentValues;
            EditorGUILayout.PropertyField(p.influenceShape, CoreEditorUtils.GetContent("Shape"));
            EditorGUI.showMixedValue = false;
            if (EditorGUI.EndChangeCheck())
            {
                s.SetShapeTarget(p.influenceShape.intValue);
            }

            switch ((ShapeType)p.influenceShape.enumValueIndex)
            {
            case ShapeType.Box:
                Drawer_InfluenceShapeBoxSettings(s, p, owner);
                break;

            case ShapeType.Sphere:
                Drawer_InfluenceShapeSphereSettings(s, p, owner);
                break;
            }
        }
        static void Drawer_InfluenceSphereSettings(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
        {
            var maxBlendDistance = HDReflectionProbeEditorUtility.CalculateSphereMaxBlendDistance(s, p, owner);

            var blendDistance = p.blendDistancePositive.vector3Value.x;

            EditorGUILayout.BeginHorizontal();
            EditorGUI.BeginChangeCheck();
            EditorGUI.showMixedValue = p.blendDistancePositive.hasMultipleDifferentValues;
            blendDistance            = EditorGUILayout.Slider(CoreEditorUtils.GetContent("Blend Distance|Area around the probe where it is blended with other probes. Only used in deferred probes."), blendDistance, 0, maxBlendDistance);
            if (EditorGUI.EndChangeCheck())
            {
                p.blendDistancePositive.vector3Value = Vector3.one * blendDistance;
                p.blendDistanceNegative.vector3Value = Vector3.one * blendDistance;
            }
            if (GUILayout.Button(toolbar_Contents[1], GUILayout.Width(28f), GUILayout.Height(EditorGUIUtility.singleLineHeight + 3)))
            {
                EditMode.ChangeEditMode(k_Toolbar_SceneViewEditModes[1], GetBoundsGetter(p)(), owner);
            }
            EditorGUILayout.EndHorizontal();

            var blendNormalDistance = p.blendNormalDistancePositive.vector3Value.x;

            EditorGUILayout.BeginHorizontal();
            EditorGUI.BeginChangeCheck();
            EditorGUI.showMixedValue = p.blendNormalDistancePositive.hasMultipleDifferentValues;
            blendNormalDistance      = EditorGUILayout.Slider(CoreEditorUtils.GetContent("Blend Normal Distance|Area around the probe where the normals influence the probe. Only used in deferred probes."), blendNormalDistance, 0, maxBlendDistance);
            if (EditorGUI.EndChangeCheck())
            {
                p.blendNormalDistancePositive.vector3Value = Vector3.one * blendNormalDistance;
                p.blendNormalDistanceNegative.vector3Value = Vector3.one * blendNormalDistance;
            }
            if (GUILayout.Button(toolbar_Contents[2], GUILayout.Width(28f), GUILayout.Height(EditorGUIUtility.singleLineHeight + 3)))
            {
                EditMode.ChangeEditMode(k_Toolbar_SceneViewEditModes[2], GetBoundsGetter(p)(), owner);
            }
            EditorGUILayout.EndHorizontal();
            EditorGUI.showMixedValue = false;
        }
        static void Drawer_InfluenceBoxSettings(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
        {
            bool advanced         = p.editorAdvancedModeEnabled.boolValue;
            var  maxBlendDistance = HDReflectionProbeEditorUtility.CalculateBoxMaxBlendDistance(s, p, owner);

            EditorGUILayout.BeginHorizontal();
            Drawer_AdvancedBlendDistance(
                p,
                false,
                maxBlendDistance,
                CoreEditorUtils.GetContent("Blend Distance|Area around the probe where it is blended with other probes. Only used in deferred probes.")
                );
            if (GUILayout.Button(toolbar_Contents[1], GUILayout.ExpandHeight(true), GUILayout.Width(28f), GUILayout.MinHeight(22f), GUILayout.MaxHeight((advanced ? 3 : 1) * (EditorGUIUtility.singleLineHeight + 3))))
            {
                EditMode.ChangeEditMode(k_Toolbar_SceneViewEditModes[1], GetBoundsGetter(p)(), owner);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            Drawer_AdvancedBlendDistance(
                p,
                true,
                maxBlendDistance,
                CoreEditorUtils.GetContent("Blend Normal Distance|Area around the probe where the normals influence the probe. Only used in deferred probes.")
                );
            if (GUILayout.Button(toolbar_Contents[2], GUILayout.ExpandHeight(true), GUILayout.Width(28f), GUILayout.MinHeight(22f), GUILayout.MaxHeight((advanced ? 3 : 1) * (EditorGUIUtility.singleLineHeight + 3))))
            {
                EditMode.ChangeEditMode(k_Toolbar_SceneViewEditModes[2], GetBoundsGetter(p)(), owner);
            }
            EditorGUILayout.EndHorizontal();

            if (advanced)
            {
                CoreEditorUtils.DrawVector6(
                    CoreEditorUtils.GetContent("Face fade|Fade faces of the cubemap."),
                    p.boxSideFadePositive, p.boxSideFadeNegative, Vector3.zero, Vector3.one, HDReflectionProbeEditor.k_handlesColor);
            }
        }
        static void Drawer_AdditionalSettings(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
        {
            EditorGUILayout.PropertyField(p.weight, CoreEditorUtils.GetContent("Influence Volume Weight|Blending weight to use while interpolating between influence volume. (Reminder: Sky is an Influence Volume too)."));

            EditorGUI.BeginChangeCheck();
            EditorGUILayout.PropertyField(p.multiplier, CoreEditorUtils.GetContent("Multiplier|Tweeking option to enhance reflection."));
            if (EditorGUI.EndChangeCheck())
            {
                p.multiplier.floatValue = Mathf.Max(0.0f, p.multiplier.floatValue);
            }

            if (p.so.targetObjects.Length == 1)
            {
                var probe = p.target;
                if (probe.mode == ReflectionProbeMode.Custom && probe.customBakedTexture != null)
                {
                    var cubemap = probe.customBakedTexture as Cubemap;
                    if (cubemap && cubemap.mipmapCount == 1)
                    {
                        EditorGUILayout.HelpBox("No mipmaps in the cubemap, Smoothness value in Standard shader will be ignored.", MessageType.Warning);
                    }
                }
            }
        }
Esempio n. 11
0
        static void Drawer_AdditionalSettings(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
        {
            EditorGUILayout.PropertyField(p.weight);

            EditorGUI.BeginChangeCheck();
            EditorGUILayout.PropertyField(p.multiplier);
            if (EditorGUI.EndChangeCheck())
            {
                p.multiplier.floatValue = Mathf.Max(0.0f, p.multiplier.floatValue);
            }

            if (p.so.targetObjects.Length == 1)
            {
                var probe = p.target;
                if (probe.mode == ReflectionProbeMode.Custom && probe.customBakedTexture != null)
                {
                    var cubemap = probe.customBakedTexture as Cubemap;
                    if (cubemap && cubemap.mipmapCount == 1)
                    {
                        EditorGUILayout.HelpBox("No mipmaps in the cubemap, Smoothness value in Standard shader will be ignored.", MessageType.Warning);
                    }
                }
            }
        }
Esempio n. 12
0
        static void Drawer_InfluenceShape(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
        {
            EditorGUI.BeginChangeCheck();
            EditorGUI.showMixedValue = p.influenceShape.hasMultipleDifferentValues;
            EditorGUILayout.PropertyField(p.influenceShape, CoreEditorUtils.GetContent("Shape"));
            EditorGUI.showMixedValue = false;
            if (EditorGUI.EndChangeCheck())
            {
                s.SetShapeTarget(p.influenceShape.intValue);
            }

            if (p.proxyVolumeComponent.objectReferenceValue != null)
            {
                var proxy = (ReflectionProxyVolumeComponent)p.proxyVolumeComponent.objectReferenceValue;
                if ((int)proxy.proxyVolume.shapeType != p.influenceShape.enumValueIndex)
                {
                    EditorGUILayout.HelpBox(
                        "Proxy volume and influence volume have different shape types, this is not supported.",
                        MessageType.Error,
                        true
                        );
                }
            }
        }
Esempio n. 13
0
        static void Handle_InfluenceEditing(HDReflectionProbeUI s, SerializedHDReflectionProbe sp, Editor o)
        {
            var mat = Handles.matrix;
            var col = Handles.color;

            Handles.matrix = HDReflectionProbeEditorUtility.GetLocalSpace(sp.target);
            switch ((ReflectionInfluenceShape)sp.influenceShape.enumValueIndex)
            {
            case ReflectionInfluenceShape.Box:
            {
                s.boxInfluenceHandle.center = sp.target.center;
                s.boxInfluenceHandle.size   = sp.target.size;

                Handles.color = k_GizmoThemeColorExtent;
                EditorGUI.BeginChangeCheck();
                s.boxInfluenceHandle.DrawHandle();
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RecordObject(sp.target, "Modified Reflection Probe AABB");
                    Undo.RecordObject(sp.targetData, "Modified Reflection Probe AABB");

                    var center = s.boxInfluenceHandle.center;
                    var size   = s.boxInfluenceHandle.size;

                    HDReflectionProbeEditorUtility.ValidateAABB(sp.target, ref center, ref size);

                    sp.target.center = center;
                    sp.target.size   = size;

                    ApplyConstraintsOnTargets(s, sp, o);

                    EditorUtility.SetDirty(sp.target);
                    EditorUtility.SetDirty(sp.targetData);
                }
                break;
            }

            case ReflectionInfluenceShape.Sphere:
            {
                s.sphereInfluenceHandle.center = sp.target.center;
                s.sphereInfluenceHandle.radius = sp.targetData.influenceSphereRadius;

                Handles.color = k_GizmoThemeColorExtent;
                EditorGUI.BeginChangeCheck();
                s.sphereInfluenceHandle.DrawHandle();
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RecordObject(sp.target, "Modified Reflection Probe AABB");
                    Undo.RecordObject(sp.targetData, "Modified Reflection Probe AABB");

                    var center          = sp.target.center;
                    var influenceRadius = s.sphereInfluenceHandle.radius;
                    var radius          = Vector3.one * influenceRadius;

                    HDReflectionProbeEditorUtility.ValidateAABB(sp.target, ref center, ref radius);
                    influenceRadius = radius.x;

                    sp.targetData.influenceSphereRadius = influenceRadius;

                    ApplyConstraintsOnTargets(s, sp, o);

                    EditorUtility.SetDirty(sp.target);
                    EditorUtility.SetDirty(sp.targetData);
                }
                break;
            }
            }
            Handles.matrix = mat;
            Handles.color  = col;
        }
 static void Drawer_InfluenceSettings(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.boxProjection, CoreEditorUtils.GetContent("Parallax Correction|Parallax Correction causes reflections to appear to change based on the object's position within the probe's box, while still using a single probe as the source of the reflection. This works well for reflections on objects that are moving through enclosed spaces such as corridors and rooms. Setting Parallax Correction to False and the cubemap reflection will be treated as coming from infinitely far away. Note that this feature can be globally disabled from Graphics Settings -> Tier Settings"));
 }
Esempio n. 15
0
 static void PerformOperations(HDReflectionProbeUI s, SerializedHDReflectionProbe p, HDReflectionProbeEditor o)
 {
 }
        static void Drawer_ModeSettingsCustom(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
        {
            EditorGUILayout.PropertyField(p.renderDynamicObjects, CoreEditorUtils.GetContent("Dynamic Objects|If enabled dynamic objects are also rendered into the cubemap"));

            p.customBakedTexture.objectReferenceValue = EditorGUILayout.ObjectField(CoreEditorUtils.GetContent("Cubemap"), p.customBakedTexture.objectReferenceValue, typeof(Cubemap), false);
        }
 static void Drawer_ModeSettingsRealtime(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.refreshMode, CoreEditorUtils.GetContent("Refresh Mode|Controls how this probe refreshes in the Player"));
     EditorGUILayout.PropertyField(p.timeSlicingMode, CoreEditorUtils.GetContent("Time Slicing|If enabled this probe will update over several frames, to help reduce the impact on the frame rate"));
 }
 static void Drawer_ProjectionSphereSettings(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.sphereReprojectionVolumeRadius);
 }
 static void Drawer_IntensityMultiplier(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.intensityMultiplier, CoreEditorUtils.GetContent("Intensity"));
 }
 static void Drawer_ProjectionBoxSettings(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.boxReprojectionVolumeSize);
     EditorGUILayout.PropertyField(p.boxReprojectionVolumeCenter);
 }
 static void Drawer_UseSeparateProjectionVolume(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
 {
     EditorGUILayout.PropertyField(p.useSeparateProjectionVolume);
     s.isSectionExpandedSeparateProjection.target = p.useSeparateProjectionVolume.boolValue;
 }
 static void Drawer_BakeActions(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
 {
     EditorReflectionSystemGUI.DrawBakeButton((ReflectionProbeMode)p.mode.intValue, p.target);
 }
Esempio n. 23
0
 public static float CalculateSphereMaxBlendDistance(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor o)
 {
     return(p.influenceSphereRadius.floatValue);
 }
Esempio n. 24
0
 public static Vector3 CalculateBoxMaxBlendDistance(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor o)
 {
     return(p.boxSize.vector3Value * 0.5f);
 }
Esempio n. 25
0
        static void Handle_InfluenceFadeEditing(HDReflectionProbeUI s, SerializedHDReflectionProbe sp, Editor o, InfluenceType influenceType)
        {
            BoxBoundsHandle    blendBox;
            SphereBoundsHandle sphereHandle;
            Vector3            probeBlendDistancePositive, probeBlendDistanceNegative;
            Color color;

            switch (influenceType)
            {
            default:
            case InfluenceType.Standard:
            {
                blendBox     = s.boxBlendHandle;
                sphereHandle = s.sphereBlendHandle;
                probeBlendDistancePositive = sp.targetData.blendDistancePositive;
                probeBlendDistanceNegative = sp.targetData.blendDistanceNegative;
                color = k_GizmoThemeColorInfluenceBlend;
                break;
            }

            case InfluenceType.Normal:
            {
                blendBox     = s.boxBlendNormalHandle;
                sphereHandle = s.sphereBlendNormalHandle;
                probeBlendDistancePositive = sp.targetData.blendNormalDistancePositive;
                probeBlendDistanceNegative = sp.targetData.blendNormalDistanceNegative;
                color = k_GizmoThemeColorInfluenceNormalBlend;
                break;
            }
            }


            var mat = Handles.matrix;
            var col = Handles.color;

            Handles.matrix = HDReflectionProbeEditorUtility.GetLocalSpace(sp.target);
            switch ((ReflectionInfluenceShape)sp.influenceShape.enumValueIndex)
            {
            case ReflectionInfluenceShape.Box:
            {
                blendBox.center = sp.target.center - (probeBlendDistancePositive - probeBlendDistanceNegative) * 0.5f;
                blendBox.size   = sp.target.size - probeBlendDistancePositive - probeBlendDistanceNegative;

                Handles.color = k_GizmoThemeColorExtent;
                EditorGUI.BeginChangeCheck();
                Handles.color = color;
                blendBox.DrawHandle();
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RecordObject(sp.target, "Modified Reflection Probe Influence");
                    Undo.RecordObject(sp.targetData, "Modified Reflection Probe Influence");

                    var center        = sp.target.center;
                    var influenceSize = sp.target.size;

                    var diff     = 2 * (blendBox.center - center);
                    var sum      = influenceSize - blendBox.size;
                    var positive = (sum - diff) * 0.5f;
                    var negative = (sum + diff) * 0.5f;
                    var blendDistancePositive = Vector3.Max(Vector3.zero, Vector3.Min(positive, influenceSize));
                    var blendDistanceNegative = Vector3.Max(Vector3.zero, Vector3.Min(negative, influenceSize));

                    probeBlendDistancePositive = blendDistancePositive;
                    probeBlendDistanceNegative = blendDistanceNegative;

                    ApplyConstraintsOnTargets(s, sp, o);

                    EditorUtility.SetDirty(sp.target);
                    EditorUtility.SetDirty(sp.targetData);
                }
                break;
            }

            case ReflectionInfluenceShape.Sphere:
            {
                sphereHandle.center = sp.target.center;
                sphereHandle.radius = Mathf.Clamp(sp.targetData.influenceSphereRadius - probeBlendDistancePositive.x, 0, sp.targetData.influenceSphereRadius);

                Handles.color = k_GizmoThemeColorExtent;
                EditorGUI.BeginChangeCheck();
                Handles.color = color;
                sphereHandle.DrawHandle();
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RecordObject(sp.target, "Modified Reflection influence volume");
                    Undo.RecordObject(sp.targetData, "Modified Reflection influence volume");

                    var influenceRadius = sp.targetData.influenceSphereRadius;
                    var blendRadius     = sphereHandle.radius;

                    var blendDistance = Mathf.Clamp(influenceRadius - blendRadius, 0, influenceRadius);

                    probeBlendDistancePositive = Vector3.one * blendDistance;
                    probeBlendDistanceNegative = probeBlendDistancePositive;

                    ApplyConstraintsOnTargets(s, sp, o);

                    EditorUtility.SetDirty(sp.target);
                    EditorUtility.SetDirty(sp.targetData);
                }
                break;
            }
            }
            Handles.matrix = mat;
            Handles.color  = col;


            switch (influenceType)
            {
            default:
            case InfluenceType.Standard:
            {
                sp.targetData.blendDistancePositive = probeBlendDistancePositive;
                sp.targetData.blendDistanceNegative = probeBlendDistanceNegative;
                break;
            }

            case InfluenceType.Normal:
            {
                sp.targetData.blendNormalDistancePositive = probeBlendDistancePositive;
                sp.targetData.blendNormalDistanceNegative = probeBlendDistanceNegative;
                break;
            }
            }
        }
        static void Drawer_BakeActions(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
        {
            if (p.mode.intValue == (int)ReflectionProbeMode.Realtime)
            {
                EditorGUILayout.HelpBox("Refresh of this reflection probe should be initiated from the scripting API because the type is 'Realtime'", MessageType.Info);

                if (!QualitySettings.realtimeReflectionProbes)
                {
                    EditorGUILayout.HelpBox("Realtime reflection probes are disabled in Quality Settings", MessageType.Warning);
                }
                return;
            }

            if (p.mode.intValue == (int)ReflectionProbeMode.Baked && UnityEditor.Lightmapping.giWorkflowMode != UnityEditor.Lightmapping.GIWorkflowMode.OnDemand)
            {
                EditorGUILayout.HelpBox("Baking of this reflection probe is automatic because this probe's type is 'Baked' and the Lighting window is using 'Auto Baking'. The cubemap created is stored in the GI cache.", MessageType.Info);
                return;
            }

            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            switch ((ReflectionProbeMode)p.mode.intValue)
            {
            case ReflectionProbeMode.Custom:
            {
                if (ButtonWithDropdownList(
                        CoreEditorUtils.GetContent("Bake|Bakes Reflection Probe's cubemap, overwriting the existing cubemap texture asset (if any)."), k_BakeCustomOptionText,
                        data =>
                    {
                        var mode = (int)data;

                        var probe = p.target;
                        if (mode == 0)
                        {
                            HDReflectionProbeEditorUtility.BakeCustomReflectionProbe(probe, false, true);
                            HDReflectionProbeEditorUtility.ResetProbeSceneTextureInMaterial(probe);
                        }
                    },
                        GUILayout.ExpandWidth(true)))
                {
                    var probe = p.target;
                    HDReflectionProbeEditorUtility.BakeCustomReflectionProbe(probe, true, true);
                    HDReflectionProbeEditorUtility.ResetProbeSceneTextureInMaterial(probe);
                    GUIUtility.ExitGUI();
                }
                break;
            }

            case ReflectionProbeMode.Baked:
            {
                GUI.enabled = p.target.enabled;

                // Bake button in non-continous mode
                if (ButtonWithDropdownList(
                        CoreEditorUtils.GetContent("Bake"),
                        k_BakeButtonsText,
                        data =>
                    {
                        var mode = (int)data;
                        if (mode == 0)
                        {
                            HDReflectionProbeEditorUtility.BakeAllReflectionProbesSnapshots();
                        }
                    },
                        GUILayout.ExpandWidth(true)))
                {
                    var probe = p.target;
                    HDReflectionProbeEditorUtility.BakeReflectionProbeSnapshot(probe);
                    HDReflectionProbeEditorUtility.ResetProbeSceneTextureInMaterial(probe);
                    GUIUtility.ExitGUI();
                }

                GUI.enabled = true;
                break;
            }

            case ReflectionProbeMode.Realtime:
                // Not showing bake button in realtime
                break;
            }
            GUILayout.FlexibleSpace();
            EditorGUILayout.EndHorizontal();
        }