Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEditor;
- [CustomPropertyDrawer(typeof(LabelAttribute), true)]
- public class CustomLabelDrawer : PropertyDrawer
- {
- public override void OnGUI(Rect rect, SerializedProperty property, GUIContent label)
- {
- try
- {
- EditorGUI.PropertyField(rect, property, new GUIContent(((LabelAttribute)attribute).Label));
- }
- catch
- {
- EditorGUI.PropertyField(rect, property, label);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement