fix component display

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

View File

@ -195,8 +195,16 @@ namespace DCFApixels.DragonECS.Unity.Editors
else else
{ {
GUIContent label = UnityEditorUtility.GetLabel(name); GUIContent label = UnityEditorUtility.GetLabel(name);
if(componentProperty.propertyType == SerializedPropertyType.Generic)
{
EditorGUILayout.PropertyField(componentProperty, label, true); 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)
{ {
OnRemoveComponentAt(index); OnRemoveComponentAt(index);