static void Drawer_SectionShapeBox(InfluenceVolumeUI s, SerializedInfluenceVolume d, Editor o, bool drawOffset, bool drawNormal) { bool advanced = d.editorAdvancedModeEnabled.boolValue; var maxFadeDistance = d.boxSize.vector3Value * 0.5f; var minFadeDistance = Vector3.zero; EditorGUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(d.boxSize, _.GetContent("Box Size")); PlanarReflectionProbeUI.Drawer_ToolBarButton(0, o, GUILayout.Width(28f), GUILayout.MinHeight(22f)); EditorGUILayout.EndHorizontal(); if (drawOffset) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(d.offset, _.GetContent("Offset")); HDReflectionProbeUI.Drawer_ToolBarButton(3, o, GUILayout.Width(28f), GUILayout.MinHeight(22f)); EditorGUILayout.EndHorizontal(); } EditorGUILayout.BeginHorizontal(); Drawer_AdvancedBlendDistance( d, false, maxFadeDistance, CoreEditorUtils.GetContent("Blend Distance|Area around the probe where it is blended with other probes. Only used in deferred probes.") ); PlanarReflectionProbeUI.Drawer_ToolBarButton(1, o, GUILayout.ExpandHeight(true), GUILayout.Width(28f), GUILayout.MinHeight(22f), GUILayout.MaxHeight((advanced ? 3 : 1) * (EditorGUIUtility.singleLineHeight + 3))); EditorGUILayout.EndHorizontal(); if (drawNormal) { EditorGUILayout.BeginHorizontal(); Drawer_AdvancedBlendDistance( d, true, maxFadeDistance, CoreEditorUtils.GetContent("Blend Normal Distance|Area around the probe where the normals influence the probe. Only used in deferred probes.") ); PlanarReflectionProbeUI.Drawer_ToolBarButton(2, o, GUILayout.ExpandHeight(true), GUILayout.Width(28f), GUILayout.MinHeight(22f), GUILayout.MaxHeight((advanced ? 3 : 1) * (EditorGUIUtility.singleLineHeight + 3))); EditorGUILayout.EndHorizontal(); } if (advanced) { CoreEditorUtils.DrawVector6( CoreEditorUtils.GetContent("Face fade|Fade faces of the cubemap."), d.boxSideFadePositive, d.boxSideFadeNegative, Vector3.zero, Vector3.one, HDReflectionProbeEditor.k_handlesColor); } }
static void Drawer_SectionShapeSphere(InfluenceVolumeUI s, SerializedInfluenceVolume d, Editor o, bool drawOffset, bool drawNormal) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(d.sphereRadius, _.GetContent("Radius")); PlanarReflectionProbeUI.Drawer_ToolBarButton(0, o, GUILayout.Width(28f), GUILayout.MinHeight(22f)); EditorGUILayout.EndHorizontal(); if (drawOffset) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(d.offset, _.GetContent("Offset")); HDReflectionProbeUI.Drawer_ToolBarButton(3, o, GUILayout.Width(28f), GUILayout.MinHeight(22f)); EditorGUILayout.EndHorizontal(); } EditorGUILayout.Space(); var maxBlendDistance = d.sphereRadius.floatValue; EditorGUILayout.BeginHorizontal(); EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(d.sphereBlendDistance, _.GetContent("Blend Distance|Area around the probe where it is blended with other probes. Only used in deferred probes.")); if (EditorGUI.EndChangeCheck()) { d.sphereBlendDistance.floatValue = Mathf.Clamp(d.sphereBlendDistance.floatValue, 0, maxBlendDistance); } PlanarReflectionProbeUI.Drawer_ToolBarButton(1, o, GUILayout.ExpandHeight(true), GUILayout.Width(28f), GUILayout.MinHeight(22f), GUILayout.MaxHeight(EditorGUIUtility.singleLineHeight + 3)); EditorGUILayout.EndHorizontal(); if (drawNormal) { EditorGUILayout.BeginHorizontal(); EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(d.sphereBlendNormalDistance, _.GetContent("Blend Distance|Area around the probe where it is blended with other probes. Only used in deferred probes.")); if (EditorGUI.EndChangeCheck()) { d.sphereBlendNormalDistance.floatValue = Mathf.Clamp(d.sphereBlendNormalDistance.floatValue, 0, maxBlendDistance); } PlanarReflectionProbeUI.Drawer_ToolBarButton(2, o, GUILayout.ExpandHeight(true), GUILayout.Width(28f), GUILayout.MinHeight(22f), GUILayout.MaxHeight(EditorGUIUtility.singleLineHeight + 3)); EditorGUILayout.EndHorizontal(); } }