|
|
|
|
|
|
|
|
|
|
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: |
|
|
|