浏览代码

Cleaning HDReflectionProbe editor code

/main
RSlysz 6 年前
当前提交
42c843f7
共有 2 个文件被更改,包括 7 次插入24 次删除
  1. 27
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Handles.cs
  2. 4
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.cs

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


static void Handle_InfluenceFadeEditing(HDReflectionProbeUI s, SerializedHDReflectionProbe sp, Editor o, InfluenceType influenceType)
{
BoxBoundsHandle blendBox;
Gizmo6FacesBoxContained alternativeBlendBox;
SphereBoundsHandle sphereHandle;
Vector3 probeBlendDistancePositive, probeBlendDistanceNegative;

case InfluenceType.Standard:
{
alternativeBlendBox = s.alternativeBoxBlendHandle;
blendBox = s.boxBlendHandle;
sphereHandle = s.sphereBlendHandle;
probeBlendDistancePositive = sp.targetData.blendDistancePositive;
probeBlendDistanceNegative = sp.targetData.blendDistanceNegative;

case InfluenceType.Normal:
{
alternativeBlendBox = s.alternativeBoxBlendNormalHandle;
blendBox = s.boxBlendNormalHandle;
sphereHandle = s.sphereBlendNormalHandle;
probeBlendDistancePositive = sp.targetData.blendNormalDistancePositive;
probeBlendDistanceNegative = sp.targetData.blendNormalDistanceNegative;

sp.target.center = center;
sp.target.size = size;
ApplyConstraintsOnTargets(s, sp, o);
//ApplyConstraintsOnTargets(s, sp, o);
EditorUtility.SetDirty(sp.target);
EditorUtility.SetDirty(sp.targetData);

sp.targetData.influenceSphereRadius = influenceRadius;
ApplyConstraintsOnTargets(s, sp, o);
//ApplyConstraintsOnTargets(s, sp, o);
EditorUtility.SetDirty(sp.target);
EditorUtility.SetDirty(sp.targetData);

var reflectionData = reflectionProbe.GetComponent<HDAdditionalReflectionData>();
Gizmos_Influence(reflectionProbe, reflectionData, null, false);
//Gizmos_Influence(reflectionProbe, reflectionData, e, false);
Gizmos_InfluenceFade(reflectionProbe, reflectionData, null, InfluenceType.Standard, false);
Gizmos_InfluenceFade(reflectionProbe, reflectionData, null, InfluenceType.Normal, false);

{
case ShapeType.Box:
{
if(e != null)
Gizmos.color = color;
if(e != null) // e == null may occure when editor have still not been created at selection while the tool is not used for this part
Gizmos.color = color;
if (isEdit)
Gizmos.DrawCube(p.center + boxCenterOffset, p.size + boxSizeOffset);
else

{
case ShapeType.Box:
{
if(e != null)
{
e.m_UIState.alternativeBoxInfluenceHandle.DrawHull(isEdit);
}
else
{
Gizmos.color = isEdit ? k_GizmoThemeColorExtentFace : k_GizmoThemeColorExtent;
if (isEdit)
Gizmos.DrawCube(p.center, p.size);
else
Gizmos.DrawWireCube(p.center, p.size);
}
Gizmos.color = k_GizmoThemeColorExtentFace;
e.m_UIState.alternativeBoxInfluenceHandle.DrawHull(isEdit);
break;
}
case ShapeType.Sphere:

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


public void ClearOperation(Operation op) { operations &= ~op; }
public void AddOperation(Operation op) { operations |= op; }
public BoxBoundsHandle boxInfluenceHandle = new BoxBoundsHandle();
public BoxBoundsHandle boxProjectionHandle = new BoxBoundsHandle();
public BoxBoundsHandle boxBlendHandle = new BoxBoundsHandle();
public BoxBoundsHandle boxBlendNormalHandle = new BoxBoundsHandle();
public Gizmo6FacesBox alternativeBoxInfluenceHandle;
public Gizmo6FacesBoxContained alternativeBoxBlendHandle;
public Gizmo6FacesBoxContained alternativeBoxBlendNormalHandle;

正在加载...
取消
保存