This repository has been archived on 2024-11-03. You can view files and clone it, but cannot push or open issues or pull requests.
snakeinabox/Assets/NaughtyAttributes/Scripts/Editor/PropertyDrawers/LabelPropertyDrawer.cs
2020-07-09 11:41:01 -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);
}
}
}