Skip to content

Commit 43dac3e

Browse files
committed
The label is now omitted from SOC items that are in an array.
1 parent e31dedb commit 43dac3e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Scripts/Editor/PropertyDrawers/CollectionItemPropertyDrawer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ public override float GetPropertyHeight(SerializedProperty property, GUIContent
7070
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
7171
{
7272
Initialize(property);
73+
74+
// If this property is inside of a list, don't show a label. It would just say something like "Element 0"
75+
// anyway which is not useful. Might as well have a bit more room to see what the value says.
76+
if (property.IsInArray())
77+
label = GUIContent.none;
7378

7479
if (OptionsAttribute.DrawType == DrawType.AsReference)
7580
{
@@ -342,4 +347,4 @@ public void OverrideFieldInfo(FieldInfo targetFieldInfo)
342347
overrideFieldInfo = targetFieldInfo;
343348
}
344349
}
345-
}
350+
}

0 commit comments

Comments
 (0)