collider のカスタムエディターで無効なパラメーターを表示しない

This commit is contained in:
ousttrue
2024-07-11 15:11:34 +09:00
parent 5500fd5051
commit 7d3aa056ce
2 changed files with 29 additions and 5 deletions

View File

@@ -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();
}
}
}
}

View File

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