Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Editor.Extras/Drawers/CustomBuiltInDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public override TriElement CreateElement(TriValue<object> propertyValue, TriElem

if (drawWithHandler)
{
handler.SetPreferredLabel(property.DisplayName);

var visualElement = handler.CreatePropertyGUI(serializedProperty);

if (visualElement != null &&
Expand Down
10 changes: 10 additions & 0 deletions Unity.InternalAPIEditorBridge.012/ScriptAttributeUtilityProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ internal PropertyHandlerProxy(PropertyHandler handler)
// ReSharper disable once InconsistentNaming
public bool hasPropertyDrawer => _handler.hasPropertyDrawer;

public void SetPreferredLabel(string label)
{
#if UNITY_2022_2_OR_NEWER
if (_handler.propertyDrawer != null)
{
_handler.propertyDrawer.m_PreferredLabel = label;
}
#endif
}

public VisualElement CreatePropertyGUI(SerializedProperty property)
{
return _handler.propertyDrawer?.CreatePropertyGUI(property);
Expand Down