mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 16:28:23 -05:00
21 lines
625 B
C#
21 lines
625 B
C#
using TriInspector;
|
|
using TriInspector.Drawers;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
[assembly: RegisterTriAttributeDrawer(typeof(LabelWidthDrawer), TriDrawerOrder.Decorator)]
|
|
|
|
namespace TriInspector.Drawers
|
|
{
|
|
public class LabelWidthDrawer : TriAttributeDrawer<LabelWidthAttribute>
|
|
{
|
|
public override void OnGUI(Rect position, TriProperty property, TriElement next)
|
|
{
|
|
var oldLabelWidth = EditorGUIUtility.labelWidth;
|
|
|
|
EditorGUIUtility.labelWidth = Attribute.Width;
|
|
next.OnGUI(position);
|
|
EditorGUIUtility.labelWidth = oldLabelWidth;
|
|
}
|
|
}
|
|
} |