pixelgon/Assets/NaughtyAttributes/Scripts/Editor/PropertyDrawers/LabelPropertyDrawer.cs
2020-06-05 11:54:36 -07:00

16 lines
507 B
C#

using UnityEngine;
using UnityEditor;
namespace NaughtyAttributes.Editor
{
[PropertyDrawer(typeof(LabelAttribute))]
public class LabelPropertyDrawer : PropertyDrawer
{
public override void DrawProperty(SerializedProperty property)
{
var labelAttribute = PropertyUtility.GetAttribute<LabelAttribute>(property);
var guiContent = new GUIContent(labelAttribute.Label);
EditorGUILayout.PropertyField(property, guiContent, true);
}
}
}