浏览代码

fix remaining shapetype renamed to shape

/main
RSlysz 6 年前
当前提交
b722d669
共有 9 个文件被更改,包括 47 次插入47 次删除
  1. 12
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Handles.cs
  2. 14
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.Drawers.cs
  3. 4
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.cs
  4. 4
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/PlanarReflectionProbeUI.Drawers.cs
  5. 4
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs
  6. 12
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Gizmos.cs
  7. 18
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Handles.cs
  8. 8
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.cs
  9. 18
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/ProxyVolumeUI.cs

12
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Handles.cs


var mat = Handles.matrix;
var col = Handles.color;
Handles.matrix = HDReflectionProbeEditorUtility.GetLocalSpace(sp.target);
switch ((ShapeType)sp.influenceShape.enumValueIndex)
switch ((Shape)sp.influenceVolume.shape.enumValueIndex)
case ShapeType.Box:
case Shape.Box:
{
alternativeBlendBox.center = sp.target.center - (probeBlendDistancePositive - probeBlendDistanceNegative) * 0.5f;
alternativeBlendBox.size = sp.target.size - probeBlendDistancePositive - probeBlendDistanceNegative;

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

var mat = Handles.matrix;
var col = Handles.color;
Handles.matrix = HDReflectionProbeEditorUtility.GetLocalSpace(sp.target);
switch ((ShapeType)sp.influenceShape.enumValueIndex)
switch ((Shape)sp.influenceVolume.shape.enumValueIndex)
case ShapeType.Box:
case Shape.Box:
{
s.alternativeBoxInfluenceHandle.center = sp.target.center;
s.alternativeBoxInfluenceHandle.size = sp.target.size;

}
break;
}
case ShapeType.Sphere:
case Shape.Sphere:
{
s.sphereInfluenceHandle.center = sp.target.center;
s.sphereInfluenceHandle.radius = sp.targetData.influenceSphereRadius;

14
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.Drawers.cs


if (p.proxyVolumeComponent.objectReferenceValue != null)
{
var proxy = (ReflectionProxyVolumeComponent)p.proxyVolumeComponent.objectReferenceValue;
if ((int)proxy.proxyVolume.shapeType != p.influenceShape.enumValueIndex)
if ((int)proxy.proxyVolume.shapeType != p.influenceVolume.shape.enumValueIndex)
EditorGUILayout.HelpBox(
"Proxy volume and influence volume have different shape types, this is not supported.",
MessageType.Error,

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 = p.influenceVolume.shape.hasMultipleDifferentValues;
EditorGUILayout.PropertyField(p.influenceVolume.shape, CoreEditorUtils.GetContent("Shape"));
s.SetShapeTarget(p.influenceShape.intValue);
s.SetShapeTarget(p.influenceVolume.shape.intValue);
switch ((ShapeType)p.influenceShape.enumValueIndex)
switch ((Shape)p.influenceVolume.shape.enumValueIndex)
case ShapeType.Box:
case Shape.Box:
case ShapeType.Sphere:
case Shape.Sphere:
Drawer_InfluenceShapeSphereSettings(s, p, owner);
break;
}

4
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.cs


{
const int k_AnimBoolSingleFieldCount = 4;
static readonly int k_ReflectionProbeModeCount = Enum.GetValues(typeof(ReflectionProbeMode)).Length;
static readonly int k_ReflectionInfluenceShapeCount = Enum.GetValues(typeof(ShapeType)).Length;
static readonly int k_ReflectionInfluenceShapeCount = Enum.GetValues(typeof(Shape)).Length;
static readonly int k_AnimBoolsCount = k_ReflectionProbeModeCount + k_ReflectionInfluenceShapeCount + k_AnimBoolSingleFieldCount;
[Flags]

GetReflectionProbeModeBool(i).target = i == value;
}
public AnimBool IsSectionExpandedShape(ShapeType value)
public AnimBool IsSectionExpandedShape(Shape value)
{
return m_AnimBools[k_AnimBoolSingleFieldCount + k_ReflectionProbeModeCount + (int)value];
}

4
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/PlanarReflectionProbeUI.Drawers.cs


static void Drawer_DifferentShapeError(PlanarReflectionProbeUI s, SerializedPlanarReflectionProbe d, Editor o)
{
var proxy = d.proxyVolumeReference.objectReferenceValue as ReflectionProxyVolumeComponent;
if (proxy != null && (int)proxy.proxyVolume.shapeType != d.influenceVolume.shapeType.enumValueIndex)
if (proxy != null && (int)proxy.proxyVolume.shapeType != d.influenceVolume.shape.enumValueIndex)
{
EditorGUILayout.HelpBox(
"Proxy volume and influence volume have different shape types, this is not supported.",

if (d.proxyVolumeReference.objectReferenceValue != null)
{
var proxy = (ReflectionProxyVolumeComponent)d.proxyVolumeReference.objectReferenceValue;
if ((int)proxy.proxyVolume.shapeType != d.influenceVolume.shapeType.enumValueIndex)
if ((int)proxy.proxyVolume.shapeType != d.influenceVolume.shape.enumValueIndex)
EditorGUILayout.HelpBox(
"Proxy volume and influence volume have different shape types, this is not supported.",
MessageType.Error,

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


CED.space,
CED.Action(Drawer_FieldShapeType),
CED.FadeGroup(
(s, d, o, i) => s.IsSectionExpanded_Shape((ShapeType)i),
(s, d, o, i) => s.IsSectionExpanded_Shape((Shape)i),
FadeOption.None,
SectionShapeBox,
SectionShapeSphere

static void Drawer_FieldShapeType(InfluenceVolumeUI s, SerializedInfluenceVolume d, Editor o)
{
EditorGUILayout.PropertyField(d.shapeType, _.GetContent("Shape Type"));
EditorGUILayout.PropertyField(d.shape, _.GetContent("Shape Type"));
}
static void Drawer_InfluenceAdvancedSwitch(InfluenceVolumeUI s, SerializedInfluenceVolume d, Editor owner)

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


var c = Gizmos.color;
Gizmos.matrix = matrix;
Gizmos.color = color;
switch (d.shapeType)
switch (d.shape)
case ShapeType.Box:
case Shape.Box:
{
s.boxBaseHandle.center = d.boxBaseOffset;
s.boxBaseHandle.size = d.boxBaseSize;

case ShapeType.Sphere:
case Shape.Sphere:
{
if (isSolid)
Gizmos.DrawSphere(d.sphereBaseOffset, d.sphereBaseRadius);

var c = Gizmos.color;
Gizmos.matrix = matrix;
Gizmos.color = color;
switch (d.shapeType)
switch (d.shape)
case ShapeType.Box:
case Shape.Box:
{
Gizmo6FacesBox refBox = isNormal ? s.boxInfluenceNormalHandle : s.boxInfluenceHandle;
refBox.center = d.boxBaseOffset + boxOffset;

}
case ShapeType.Sphere:
case Shape.Sphere:
{
if (isSolid)
Gizmos.DrawSphere(d.sphereBaseOffset, d.sphereBaseRadius + sphereOffset);

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


var c = Handles.color;
Handles.matrix = matrix;
Handles.color = k_GizmoThemeColorBase;
switch (d.shapeType)
switch (d.shape)
case ShapeType.Box:
case Shape.Box:
{
var center = d.boxBaseOffset;
var size = d.boxBaseSize;

d.boxBaseSize = size;
break;
}
case ShapeType.Sphere:
case Shape.Sphere:
{
var center = d.sphereBaseOffset;
var radius = d.sphereBaseRadius;

var c = Handles.color;
Handles.matrix = matrix;
Handles.color = k_GizmoThemeColorInfluence;
switch (d.shapeType)
switch (d.shape)
case ShapeType.Box:
case Shape.Box:
{
var positive = d.boxInfluencePositiveFade;
var negative = d.boxInfluenceNegativeFade;

s.data.Apply();
break;
}
case ShapeType.Sphere:
case Shape.Sphere:
{
var fade = d.sphereInfluenceFade;
DrawSphereFadeHandle(

var c = Handles.color;
Handles.matrix = matrix;
Handles.color = k_GizmoThemeColorInfluenceNormal;
switch (d.shapeType)
switch (d.shape)
case ShapeType.Box:
case Shape.Box:
{
Vector3 positive = d.boxInfluenceNormalPositiveFade;

s.data.Apply();
break;
}
case ShapeType.Sphere:
case Shape.Sphere:
{
var fade = d.sphereInfluenceNormalFade;
DrawSphereFadeHandle(

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


internal static readonly Color k_GizmoThemeColorDisabled = new Color(0x99 / 255f, 0x89 / 255f, 0x59 / 255f, 0x10 / 255f);
internal static readonly Color k_GizmoThemeColorDisabledFace = new Color(0x99 / 255f, 0x89 / 255f, 0x59 / 255f, 0x10 / 255f);
static readonly int k_ShapeCount = Enum.GetValues(typeof(ShapeType)).Length;
static readonly int k_ShapeCount = Enum.GetValues(typeof(Shape)).Length;
public Gizmo6FacesBox boxBaseHandle;
public Gizmo6FacesBoxContained boxInfluenceHandle;

public override void Update()
{
base.Update();
SetIsSectionExpanded_Shape((ShapeType)data.shapeType.intValue);
SetIsSectionExpanded_Shape((Shape)data.shape.intValue);
void SetIsSectionExpanded_Shape(ShapeType shape)
void SetIsSectionExpanded_Shape(Shape shape)
public AnimBool IsSectionExpanded_Shape(ShapeType shapeType)
public AnimBool IsSectionExpanded_Shape(Shape shapeType)
{
return m_AnimBools[(int)shapeType];
}

18
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/ProxyVolumeUI.cs


internal static Color k_GizmoThemeColorDisabled = new Color(0x99 / 255f, 0x89 / 255f, 0x59 / 255f, 0x10 / 255f);
internal static Color k_GizmoThemeColorDisabledFace = new Color(0x99 / 255f, 0x89 / 255f, 0x59 / 255f, 0x10 / 255f);
static readonly int k_ShapeCount = Enum.GetValues(typeof(ShapeType)).Length;
static readonly int k_ShapeCount = Enum.GetValues(typeof(Shape)).Length;
public static readonly CED.IDrawer SectionShape;

SectionShape = CED.Group(
CED.Action(Drawer_FieldShapeType),
CED.FadeGroup(
(s, d, o, i) => s.IsSectionExpanded_Shape((ShapeType)i),
(s, d, o, i) => s.IsSectionExpanded_Shape((Shape)i),
FadeOption.Indent,
SectionShapeBox,
SectionShapeSphere

{
base.Update();
if (data != null)
SetIsSectionExpanded_Shape((ShapeType)data.shapeType.intValue);
SetIsSectionExpanded_Shape((Shape)data.shapeType.intValue);
void SetIsSectionExpanded_Shape(ShapeType shape)
void SetIsSectionExpanded_Shape(Shape shape)
public AnimBool IsSectionExpanded_Shape(ShapeType shapeType)
public AnimBool IsSectionExpanded_Shape(Shape shapeType)
{
return m_AnimBools[(int)shapeType];
}

{
switch (proxyVolume.shapeType)
{
case ShapeType.Box:
case Shape.Box:
case ShapeType.Sphere:
case Shape.Sphere:
Handles_EditBase_Sphere(transform, proxyVolume, ui, sourceAsset);
break;
}

{
switch (proxyVolume.shapeType)
{
case ShapeType.Box:
case Shape.Box:
case ShapeType.Sphere:
case Shape.Sphere:
Gizmos_EditNone_Sphere(transform, proxyVolume, ui, sourceAsset);
break;
}

正在加载...
取消
保存