|
|
|
|
|
|
|
|
|
|
EditorGUI.BeginChangeCheck(); |
|
|
|
s.boxInfluenceBoundsHandle.DrawHandle(); |
|
|
|
var influenceChanged = EditorGUI.EndChangeCheck(); |
|
|
|
EditorGUI.BeginChangeCheck(); |
|
|
|
if (EditorGUI.EndChangeCheck()) |
|
|
|
if (influenceChanged || EditorGUI.EndChangeCheck()) |
|
|
|
{ |
|
|
|
Undo.RecordObject(p, "Modified Reflection Probe AABB"); |
|
|
|
var center = s.boxInfluenceBoundsHandle.center; |
|
|
|
|
|
|
var blendDistance = ((influenceSize.x - blendSize.x) * 0.5f + (influenceSize.y - blendSize.y) * 0.5f + (influenceSize.z - blendSize.z) * 0.5f) / 3; |
|
|
|
var blendDistance = influenceChanged |
|
|
|
? p.blendDistance |
|
|
|
: ((influenceSize.x - blendSize.x) * 0.5f + (influenceSize.y - blendSize.y) * 0.5f + (influenceSize.z - blendSize.z) * 0.5f) / 3; |
|
|
|
p.center = center; |
|
|
|
p.size = influenceSize; |
|
|
|
p.blendDistance = Mathf.Max(blendDistance, 0); |
|
|
|
|
|
|
|
|
|
|
EditorGUI.BeginChangeCheck(); |
|
|
|
s.influenceSphereHandle.DrawHandle(); |
|
|
|
var influenceChanged = EditorGUI.EndChangeCheck(); |
|
|
|
EditorGUI.BeginChangeCheck(); |
|
|
|
if (EditorGUI.EndChangeCheck()) |
|
|
|
if (influenceChanged || EditorGUI.EndChangeCheck()) |
|
|
|
var influenceRadius = Mathf.Max(s.influenceSphereHandle.radius, s.sphereBlendHandle.radius); |
|
|
|
var blendRadius = Mathf.Min(s.influenceSphereHandle.radius, s.sphereBlendHandle.radius); |
|
|
|
var influenceRadius =s.influenceSphereHandle.radius; |
|
|
|
var blendRadius = influenceChanged |
|
|
|
? influenceRadius - p.blendDistance * 2 |
|
|
|
: s.sphereBlendHandle.radius; |
|
|
|
|
|
|
|
var radius = Vector3.one * influenceRadius; |
|
|
|
|
|
|
|