浏览代码

fix InfluenceVolumeUI

/main
RSlysz 6 年前
当前提交
9627aa57
共有 3 个文件被更改,包括 51 次插入51 次删除
  1. 30
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs
  2. 24
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Gizmos.cs
  3. 48
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Handles.cs

30
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs


d.editorAdvancedModeEnabled.boolValue = advanced;
if (advanced)
{
d.boxInfluencePositiveFade.vector3Value = d.editorAdvancedModeBlendDistancePositive.vector3Value;
d.boxInfluenceNegativeFade.vector3Value = d.editorAdvancedModeBlendDistanceNegative.vector3Value;
d.boxInfluenceNormalPositiveFade.vector3Value = d.editorAdvancedModeBlendNormalDistancePositive.vector3Value;
d.boxInfluenceNormalNegativeFade.vector3Value = d.editorAdvancedModeBlendNormalDistanceNegative.vector3Value;
d.boxBlendDistancePositive.vector3Value = d.editorAdvancedModeBlendDistancePositive.vector3Value;
d.boxBlendDistanceNegative.vector3Value = d.editorAdvancedModeBlendDistanceNegative.vector3Value;
d.boxBlendNormalDistancePositive.vector3Value = d.editorAdvancedModeBlendNormalDistancePositive.vector3Value;
d.boxBlendNormalDistanceNegative.vector3Value = d.editorAdvancedModeBlendNormalDistanceNegative.vector3Value;
d.boxInfluenceNegativeFade.vector3Value = d.boxInfluencePositiveFade.vector3Value = Vector3.one * d.editorSimplifiedModeBlendDistance.floatValue;
d.boxInfluenceNormalNegativeFade.vector3Value = d.boxInfluenceNormalPositiveFade.vector3Value = Vector3.one * d.editorSimplifiedModeBlendNormalDistance.floatValue;
d.boxBlendDistanceNegative.vector3Value = d.boxBlendDistancePositive.vector3Value = Vector3.one * d.editorSimplifiedModeBlendDistance.floatValue;
d.boxBlendNormalDistanceNegative.vector3Value = d.boxBlendNormalDistancePositive.vector3Value = Vector3.one * d.editorSimplifiedModeBlendNormalDistance.floatValue;
}
d.Apply();
}

static void Drawer_SectionShapeBox(InfluenceVolumeUI s, SerializedInfluenceVolume d, Editor o)
{
bool advanced = d.editorAdvancedModeEnabled.boolValue;
var maxFadeDistance = d.boxBaseSize.vector3Value * 0.5f;
var maxFadeDistance = d.boxSize.vector3Value * 0.5f;
EditorGUILayout.PropertyField(d.boxBaseSize, _.GetContent("Box Size"));
EditorGUILayout.PropertyField(d.boxSize, _.GetContent("Box Size"));
PlanarReflectionProbeUI.Drawer_ToolBarButton(0, o, GUILayout.Width(28f), GUILayout.MinHeight(22f));
EditorGUILayout.EndHorizontal();

{
CoreEditorUtils.DrawVector6(
CoreEditorUtils.GetContent("Face fade|Fade faces of the cubemap."),
d.boxPositiveFaceFade, d.boxNegativeFaceFade, Vector3.zero, Vector3.one, HDReflectionProbeEditor.k_handlesColor);
d.boxSideFadePositive, d.boxSideFadeNegative, Vector3.zero, Vector3.one, HDReflectionProbeEditor.k_handlesColor);
SerializedProperty blendDistancePositive = isNormal ? d.boxInfluenceNormalPositiveFade : d.boxInfluencePositiveFade;
SerializedProperty blendDistanceNegative = isNormal ? d.boxInfluenceNormalNegativeFade : d.boxInfluenceNegativeFade;
SerializedProperty blendDistancePositive = isNormal ? d.boxBlendNormalDistancePositive : d.boxBlendDistancePositive;
SerializedProperty blendDistanceNegative = isNormal ? d.boxBlendNormalDistanceNegative : d.boxBlendDistanceNegative;
SerializedProperty editorAdvancedModeBlendDistancePositive = isNormal ? d.editorAdvancedModeBlendNormalDistancePositive : d.editorAdvancedModeBlendDistancePositive;
SerializedProperty editorAdvancedModeBlendDistanceNegative = isNormal ? d.editorAdvancedModeBlendNormalDistanceNegative : d.editorAdvancedModeBlendDistanceNegative;
SerializedProperty editorSimplifiedModeBlendDistance = isNormal ? d.editorSimplifiedModeBlendNormalDistance : d.editorSimplifiedModeBlendDistance;

static void Drawer_SectionShapeSphere(InfluenceVolumeUI s, SerializedInfluenceVolume d, Editor o)
{
var maxFaceDistance = d.sphereBaseRadius.floatValue;
var maxFaceDistance = d.sphereRadius.floatValue;
EditorGUILayout.PropertyField(d.sphereBaseRadius, _.GetContent("Radius"));
d.sphereBaseOffset.vector3Value = Vector3.zero;
EditorGUILayout.PropertyField(d.sphereRadius, _.GetContent("Radius"));
d.offset.vector3Value = Vector3.zero;
EditorGUILayout.Slider(d.sphereInfluenceFade, 0, maxFaceDistance, _.GetContent("Blend Distance"));
EditorGUILayout.Slider(d.sphereBlendDistance, 0, maxFaceDistance, _.GetContent("Blend Distance"));
}
}
}

24
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Gizmos.cs


if ((showedHandle & HandleType.Influence) != 0)
DrawGizmos_FadeHandle(
s, d, matrix,
d.boxInfluenceOffset, d.boxInfluenceSizeOffset,
d.sphereInfluenceRadiusOffset,
d.boxBlendOffset, d.boxBlendSize,
-d.sphereBlendDistance,
(editedHandle & HandleType.Influence) != 0,
k_GizmoThemeColorInfluence,
false);

s, d, matrix,
d.boxInfluenceNormalOffset, d.boxInfluenceNormalSizeOffset,
d.sphereInfluenceNormalRadiusOffset,
d.boxBlendNormalOffset, d.boxBlendNormalSize,
-d.sphereBlendNormalDistance,
(editedHandle & HandleType.InfluenceNormal) != 0,
k_GizmoThemeColorInfluenceNormal,
true);

{
case Shape.Box:
{
s.boxBaseHandle.center = d.boxBaseOffset;
s.boxBaseHandle.size = d.boxBaseSize;
s.boxBaseHandle.center = d.offset;
s.boxBaseHandle.size = d.boxSize;
s.boxBaseHandle.DrawHull(isSolid);
break;
}

Gizmos.DrawSphere(d.sphereBaseOffset, d.sphereBaseRadius);
Gizmos.DrawSphere(d.offset, d.sphereRadius);
Gizmos.DrawWireSphere(d.sphereBaseOffset, d.sphereBaseRadius);
Gizmos.DrawWireSphere(d.offset, d.sphereRadius);
break;
}
}

case Shape.Box:
{
Gizmo6FacesBox refBox = isNormal ? s.boxInfluenceNormalHandle : s.boxInfluenceHandle;
refBox.center = d.boxBaseOffset + boxOffset;
refBox.size = d.boxBaseSize + boxSizeOffset;
refBox.center = d.offset + boxOffset;
refBox.size = d.boxSize + boxSizeOffset;
refBox.DrawHull(isSolid);
break;
}

Gizmos.DrawSphere(d.sphereBaseOffset, d.sphereBaseRadius + sphereOffset);
Gizmos.DrawSphere(d.offset, d.sphereRadius + sphereOffset);
Gizmos.DrawWireSphere(d.sphereBaseOffset, d.sphereBaseRadius + sphereOffset);
Gizmos.DrawWireSphere(d.offset, d.sphereRadius + sphereOffset);
break;
}
}

48
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Handles.cs


{
case Shape.Box:
{
var center = d.boxBaseOffset;
var size = d.boxBaseSize;
var center = d.offset;
var size = d.boxSize;
d.boxBaseOffset = center;
d.boxBaseSize = size;
d.offset = center;
d.boxSize = size;
var center = d.sphereBaseOffset;
var radius = d.sphereBaseRadius;
var center = d.offset;
var radius = d.sphereRadius;
d.sphereBaseOffset = center;
d.sphereBaseRadius = radius;
d.offset = center;
d.sphereRadius = radius;
break;
}
}

{
case Shape.Box:
{
var positive = d.boxInfluencePositiveFade;
var negative = d.boxInfluenceNegativeFade;
var positive = d.boxBlendDistancePositive;
var negative = d.boxBlendDistanceNegative;
d.boxBaseOffset, d.boxBaseSize,
d.offset, d.boxSize,
s.data.boxInfluencePositiveFade.vector3Value = positive;
s.data.boxInfluenceNegativeFade.vector3Value = negative;
s.data.boxBlendDistancePositive.vector3Value = positive;
s.data.boxBlendDistanceNegative.vector3Value = negative;
//save advanced/simplified saved data
if (s.data.editorAdvancedModeEnabled.boolValue)

}
case Shape.Sphere:
{
var fade = d.sphereInfluenceFade;
var fade = d.sphereBlendDistance;
d.sphereBaseOffset, d.sphereBaseRadius,
d.offset, d.sphereRadius,
d.sphereInfluenceFade = fade;
d.sphereBlendDistance = fade;
break;
}
}

case Shape.Box:
{
Vector3 positive = d.boxInfluenceNormalPositiveFade;
Vector3 negative = d.boxInfluenceNormalNegativeFade;
Vector3 positive = d.boxBlendNormalDistancePositive;
Vector3 negative = d.boxBlendNormalDistanceNegative;
d.boxBaseOffset, d.boxBaseSize,
d.offset, d.boxSize,
s.data.boxInfluenceNormalPositiveFade.vector3Value = positive;
s.data.boxInfluenceNormalNegativeFade.vector3Value = negative;
s.data.boxBlendNormalDistancePositive.vector3Value = positive;
s.data.boxBlendNormalDistanceNegative.vector3Value = negative;
//save advanced/simplified saved data
if (s.data.editorAdvancedModeEnabled.boolValue)

}
case Shape.Sphere:
{
var fade = d.sphereInfluenceNormalFade;
var fade = d.sphereBlendNormalDistance;
d.sphereBaseOffset, d.sphereBaseRadius,
d.offset, d.sphereRadius,
d.sphereInfluenceNormalFade = fade;
d.sphereBlendNormalDistance = fade;
break;
}
}

正在加载...
取消
保存