fix component display

This commit is contained in:
Mikhail 2024-05-05 00:59:26 +08:00
parent 6897bba150
commit bfccfbdae7

View File

@ -195,7 +195,15 @@ namespace DCFApixels.DragonECS.Unity.Editors
else else
{ {
GUIContent label = UnityEditorUtility.GetLabel(name); GUIContent label = UnityEditorUtility.GetLabel(name);
EditorGUILayout.PropertyField(componentProperty, label, true); if(componentProperty.propertyType == SerializedPropertyType.Generic)
{
EditorGUILayout.PropertyField(componentProperty, label, true);
}
else
{
Rect r = RectUtility.AddPadding(GUILayoutUtility.GetRect(label, EditorStyles.objectField), 0, 20f, 0, 0);
EditorGUI.PropertyField(r, componentProperty, label, true);
}
} }
if (isRemoveComponent) if (isRemoveComponent)
{ {