fix: add BeginProperty to AvatarObjectReferenceDrawer

This commit is contained in:
Rerigferl 2024-12-17 17:07:52 +09:00
parent cca9e22edd
commit ad9d9019c5
No known key found for this signature in database

View File

@ -7,6 +7,9 @@ namespace nadena.dev.modular_avatar.core.editor
internal class AvatarObjectReferenceDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
label = EditorGUI.BeginProperty(position, label, property);
try
{
if (CustomGUI(position, property, label)) return;
@ -24,6 +27,11 @@ namespace nadena.dev.modular_avatar.core.editor
string.IsNullOrEmpty(property.stringValue) ? "(null)" : property.stringValue);
}
}
finally
{
EditorGUI.EndProperty();
}
}
private bool CustomGUI(Rect position, SerializedProperty property, GUIContent label)
{