|
|
|
|
|
|
switch (d.shapeType) |
|
|
|
{ |
|
|
|
case ShapeType.Box: |
|
|
|
{ |
|
|
|
var center = d.boxBaseOffset; |
|
|
|
var size = d.boxBaseSize; |
|
|
|
DrawBoxHandle( |
|
|
|
s, d, o, sourceAsset, |
|
|
|
s1 => s1.boxBaseHandle, |
|
|
|
ref center, |
|
|
|
ref size); |
|
|
|
d.boxBaseOffset = center; |
|
|
|
d.boxBaseSize = size; |
|
|
|
break; |
|
|
|
} |
|
|
|
{ |
|
|
|
var center = d.boxBaseOffset; |
|
|
|
var size = d.boxBaseSize; |
|
|
|
DrawBoxHandle( |
|
|
|
s, d, o, sourceAsset, |
|
|
|
s1 => s1.boxBaseHandle, |
|
|
|
ref center, |
|
|
|
ref size); |
|
|
|
d.boxBaseOffset = center; |
|
|
|
d.boxBaseSize = size; |
|
|
|
break; |
|
|
|
} |
|
|
|
{ |
|
|
|
var center = d.sphereBaseOffset; |
|
|
|
var radius = d.sphereBaseRadius; |
|
|
|
DrawSphereHandle( |
|
|
|
s, d, o, sourceAsset, |
|
|
|
s1 => s1.sphereBaseHandle, |
|
|
|
ref center, |
|
|
|
ref radius); |
|
|
|
d.sphereBaseOffset = center; |
|
|
|
d.sphereBaseRadius = radius; |
|
|
|
break; |
|
|
|
} |
|
|
|
{ |
|
|
|
var center = d.sphereBaseOffset; |
|
|
|
var radius = d.sphereBaseRadius; |
|
|
|
DrawSphereHandle( |
|
|
|
s, d, o, sourceAsset, |
|
|
|
s1 => s1.sphereBaseHandle, |
|
|
|
ref center, |
|
|
|
ref radius); |
|
|
|
d.sphereBaseOffset = center; |
|
|
|
d.sphereBaseRadius = radius; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
Handles.matrix = mat; |
|
|
|
Handles.color = c; |
|
|
|
|
|
|
switch (d.shapeType) |
|
|
|
{ |
|
|
|
case ShapeType.Box: |
|
|
|
{ |
|
|
|
var positive = d.boxInfluencePositiveFade; |
|
|
|
var negative = d.boxInfluenceNegativeFade; |
|
|
|
DrawBoxFadeHandle( |
|
|
|
s, d, o, sourceAsset, |
|
|
|
s1 => s1.boxInfluenceHandle, |
|
|
|
d.boxBaseOffset, d.boxBaseSize, |
|
|
|
ref positive, |
|
|
|
ref negative); |
|
|
|
d.boxInfluencePositiveFade = positive; |
|
|
|
d.boxInfluenceNegativeFade = negative; |
|
|
|
break; |
|
|
|
} |
|
|
|
{ |
|
|
|
var positive = d.boxInfluencePositiveFade; |
|
|
|
var negative = d.boxInfluenceNegativeFade; |
|
|
|
DrawBoxFadeHandle( |
|
|
|
s, d, o, sourceAsset, |
|
|
|
s1 => s1.boxInfluenceHandle, |
|
|
|
d.boxBaseOffset, d.boxBaseSize, |
|
|
|
ref positive, |
|
|
|
ref negative); |
|
|
|
s.data.boxInfluencePositiveFade.vector3Value = positive; |
|
|
|
s.data.boxInfluenceNegativeFade.vector3Value = negative; |
|
|
|
|
|
|
|
//save advanced/simplified saved data
|
|
|
|
if (s.data.editorAdvancedModeEnabled.boolValue) |
|
|
|
{ |
|
|
|
s.data.editorAdvancedModeBlendDistancePositive.vector3Value = positive; |
|
|
|
s.data.editorAdvancedModeBlendDistanceNegative.vector3Value = negative; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
s.data.editorSimplifiedModeBlendDistance.floatValue = positive.x; |
|
|
|
} |
|
|
|
s.data.Apply(); |
|
|
|
break; |
|
|
|
} |
|
|
|
{ |
|
|
|
var fade = d.sphereInfluenceFade; |
|
|
|
DrawSphereFadeHandle( |
|
|
|
s, d, o, sourceAsset, |
|
|
|
s1 => s1.sphereInfluenceHandle, |
|
|
|
d.sphereBaseOffset, d.sphereBaseRadius, |
|
|
|
ref fade); |
|
|
|
d.sphereInfluenceFade = fade; |
|
|
|
break; |
|
|
|
} |
|
|
|
{ |
|
|
|
var fade = d.sphereInfluenceFade; |
|
|
|
DrawSphereFadeHandle( |
|
|
|
s, d, o, sourceAsset, |
|
|
|
s1 => s1.sphereInfluenceHandle, |
|
|
|
d.sphereBaseOffset, d.sphereBaseRadius, |
|
|
|
ref fade); |
|
|
|
d.sphereInfluenceFade = fade; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
Handles.matrix = mat; |
|
|
|
Handles.color = c; |
|
|
|
|
|
|
switch (d.shapeType) |
|
|
|
{ |
|
|
|
case ShapeType.Box: |
|
|
|
{ |
|
|
|
var positive = d.boxInfluenceNormalPositiveFade; |
|
|
|
var negative = d.boxInfluenceNormalNegativeFade; |
|
|
|
DrawBoxFadeHandle( |
|
|
|
s, d, o, sourceAsset, |
|
|
|
s1 => s1.boxInfluenceNormalHandle, |
|
|
|
d.boxBaseOffset, d.boxBaseSize, |
|
|
|
ref positive, |
|
|
|
ref negative); |
|
|
|
d.boxInfluenceNormalPositiveFade = positive; |
|
|
|
d.boxInfluenceNormalNegativeFade = negative; |
|
|
|
break; |
|
|
|
} |
|
|
|
{ |
|
|
|
|
|
|
|
Vector3 positive = d.boxInfluenceNormalPositiveFade; |
|
|
|
Vector3 negative = d.boxInfluenceNormalNegativeFade; |
|
|
|
DrawBoxFadeHandle( |
|
|
|
s, d, o, sourceAsset, |
|
|
|
s1 => s1.boxInfluenceNormalHandle, |
|
|
|
d.boxBaseOffset, d.boxBaseSize, |
|
|
|
ref positive, |
|
|
|
ref negative); |
|
|
|
s.data.boxInfluenceNormalPositiveFade.vector3Value = positive; |
|
|
|
s.data.boxInfluenceNormalNegativeFade.vector3Value = negative; |
|
|
|
|
|
|
|
//save advanced/simplified saved data
|
|
|
|
if (s.data.editorAdvancedModeEnabled.boolValue) |
|
|
|
{ |
|
|
|
s.data.editorAdvancedModeBlendNormalDistancePositive.vector3Value = positive; |
|
|
|
s.data.editorAdvancedModeBlendNormalDistanceNegative.vector3Value = negative; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
s.data.editorSimplifiedModeBlendNormalDistance.floatValue = positive.x; |
|
|
|
} |
|
|
|
s.data.Apply(); |
|
|
|
break; |
|
|
|
} |
|
|
|
{ |
|
|
|
var fade = d.sphereInfluenceNormalFade; |
|
|
|
DrawSphereFadeHandle( |
|
|
|
s, d, o, sourceAsset, |
|
|
|
s1 => s1.sphereInfluenceNormalHandle, |
|
|
|
d.sphereBaseOffset, d.sphereBaseRadius, |
|
|
|
ref fade); |
|
|
|
d.sphereInfluenceNormalFade = fade; |
|
|
|
break; |
|
|
|
} |
|
|
|
{ |
|
|
|
var fade = d.sphereInfluenceNormalFade; |
|
|
|
DrawSphereFadeHandle( |
|
|
|
s, d, o, sourceAsset, |
|
|
|
s1 => s1.sphereInfluenceNormalHandle, |
|
|
|
d.sphereBaseOffset, d.sphereBaseRadius, |
|
|
|
ref fade); |
|
|
|
d.sphereInfluenceNormalFade = fade; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
Handles.matrix = mat; |
|
|
|
Handles.color = c; |
|
|
|
|
|
|
|
|
|
|
b.center = baseOffset - (positive - negative) * 0.5f; |
|
|
|
b.size = baseSize - positive - negative; |
|
|
|
b.allHandleControledByOne = !s.data.editorAdvancedModeEnabled.boolValue; |
|
|
|
|
|
|
|
EditorGUI.BeginChangeCheck(); |
|
|
|
b.DrawHandle(); |
|
|
|