mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 00:08:51 -05:00
Fix label for StringDrawer
This commit is contained in:
parent
38b7dc062a
commit
f994a8aac7
@ -13,7 +13,7 @@ namespace TriInspector.Drawers
|
||||
{
|
||||
if (value.Property.TryGetSerializedProperty(out var serializedProperty))
|
||||
{
|
||||
return new StringSerializedPropertyDrawerElement(serializedProperty);
|
||||
return new StringSerializedPropertyDrawerElement(value.Property, serializedProperty);
|
||||
}
|
||||
|
||||
return new StringDrawerElement(value);
|
||||
@ -50,10 +50,12 @@ namespace TriInspector.Drawers
|
||||
|
||||
private class StringSerializedPropertyDrawerElement : TriElement
|
||||
{
|
||||
private readonly TriProperty _property;
|
||||
private readonly SerializedProperty _serializedProperty;
|
||||
|
||||
public StringSerializedPropertyDrawerElement(SerializedProperty serializedProperty)
|
||||
public StringSerializedPropertyDrawerElement(TriProperty property, SerializedProperty serializedProperty)
|
||||
{
|
||||
_property = property;
|
||||
_serializedProperty = serializedProperty;
|
||||
}
|
||||
|
||||
@ -64,7 +66,7 @@ namespace TriInspector.Drawers
|
||||
|
||||
public override void OnGUI(Rect position)
|
||||
{
|
||||
EditorGUI.PropertyField(position, _serializedProperty);
|
||||
EditorGUI.PropertyField(position, _serializedProperty, _property.DisplayNameContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user