#325 - Fixed a bug that expandable draws label twice. #338
Conversation
… display error in Scriptable Wizard
|
This issue has the same problem and may be fixed, too. |
|
Looking forward to seeing this one merged! |
|
nice good job |
There was a problem hiding this comment.
Pull request overview
Fixes a Unity Editor drawing issue in ExpandablePropertyDrawer where an expandable ScriptableObject reference can render its label twice (notably visible in ScriptableWizard UI).
Changes:
- Updates the ScriptableObject reference field drawing call to avoid passing a label explicitly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }; | ||
|
|
||
| EditorGUI.PropertyField(propertyRect, property, label, false); | ||
| EditorGUI.PropertyField(propertyRect, property, false); |
There was a problem hiding this comment.
EditorGUI.PropertyField(propertyRect, property, false) still draws a label (it treats the label as null and falls back to property.displayName), so the foldout label and the object field label can still be rendered twice. To truly suppress the second label, pass an explicit empty label (e.g., GUIContent.none) and let the foldout handle the label area.

It may cause display error in Scriptable Wizard.
In ExpandablePropertyDrawer.cs:
This problem was not discovered in inspector for the label totally overlaped when drawing twice.
But in Scriptable Wizard, the second label can't overlap on the first label (Maybe for the indent reason)