using UnityEditor;
using UnityEngine;

namespace FVS
{
    [CustomPropertyDrawer(typeof(LocalizedTooltipAttribute), true)]
    public class LocalizedTooltipDrawer : PropertyDrawer
    {
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            var attr = (LocalizedTooltipAttribute)attribute;
            var text = EditorL10n.Get(attr.Key);
            label = new GUIContent(text, label.image, text);
            EditorGUI.PropertyField(position, property, label, true);
        }
    }
}
