mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-11 05:19:14 -05:00
collider のカスタムエディターで無効なパラメーターを表示しない
This commit is contained in:
@@ -14,10 +14,34 @@ namespace UniVRM10
|
||||
Repaint();
|
||||
}
|
||||
var property = serializedObject.FindProperty("m_Script");
|
||||
var script = (VRM10SpringBoneCollider)target;
|
||||
EditorGUILayout.PropertyField(property, new GUIContent("Script (" + script.GetIdentificationName() + ")"));
|
||||
DrawPropertiesExcluding(serializedObject, "m_Script");
|
||||
var component = (VRM10SpringBoneCollider)target;
|
||||
EditorGUILayout.PropertyField(property, new GUIContent("Script (" + component.GetIdentificationName() + ")"));
|
||||
switch (component.ColliderType)
|
||||
{
|
||||
case VRM10SpringBoneColliderTypes.Plane:
|
||||
// radius: x
|
||||
// tail: x
|
||||
// normal: o
|
||||
DrawPropertiesExcluding(serializedObject, "m_Script", nameof(component.Tail), nameof(component.Radius));
|
||||
break;
|
||||
|
||||
case VRM10SpringBoneColliderTypes.Sphere:
|
||||
case VRM10SpringBoneColliderTypes.SphereInside:
|
||||
// radius: o
|
||||
// tail: x
|
||||
// normal: x
|
||||
DrawPropertiesExcluding(serializedObject, nameof(component.Tail), nameof(component.Normal), "m_Script");
|
||||
break;
|
||||
|
||||
case VRM10SpringBoneColliderTypes.Capsule:
|
||||
case VRM10SpringBoneColliderTypes.CapsuleInside:
|
||||
// radius: o
|
||||
// tail: o
|
||||
// normal: x
|
||||
DrawPropertiesExcluding(serializedObject, nameof(component.Normal), "m_Script");
|
||||
break;
|
||||
}
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ namespace UniVRM10
|
||||
|
||||
case VRM10SpringBoneColliderTypes.Plane:
|
||||
Gizmos.color = Color.magenta;
|
||||
DrawPlane(transform.localToWorldMatrix, Offset, Normal, Radius);
|
||||
DrawPlane(transform.localToWorldMatrix, Offset, Normal, 0.05f);
|
||||
break;
|
||||
|
||||
case VRM10SpringBoneColliderTypes.SphereInside:
|
||||
|
||||
Reference in New Issue
Block a user