mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 00:08:51 -05:00
Fix UIToolkit drawer title
This commit is contained in:
parent
af37b2afa7
commit
05b0932901
@ -25,6 +25,8 @@ namespace TriInspector.Drawers
|
||||
|
||||
if (drawWithHandler)
|
||||
{
|
||||
handler.SetPreferredLabel(property.DisplayName);
|
||||
|
||||
var visualElement = handler.CreatePropertyGUI(serializedProperty);
|
||||
|
||||
if (visualElement != null &&
|
||||
|
@ -25,6 +25,16 @@ namespace TriInspectorUnityInternalBridge
|
||||
// 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);
|
||||
|
Loading…
Reference in New Issue
Block a user