using System; using UnityEngine; namespace Jovian.InspectorTools.Internal { [AttributeUsage(AttributeTargets.Field)] public abstract class AttributeBase : PropertyAttribute { #if UNITY_EDITOR /// /// Validation is called before all other methods. /// Once in OnGUI and once in GetPropertyHeight /// public virtual void ValidateProperty(UnityEditor.SerializedProperty property) { } public virtual void OnBeforeGUI(Rect position, UnityEditor.SerializedProperty property, GUIContent label) { } /// /// Called once per AttributeBase group. /// I.e. if something with higher order is drawn, later will be skipped /// /// false if nothing is drawn public virtual bool OnGUI(Rect position, UnityEditor.SerializedProperty property, GUIContent label) { return false; } public virtual void OnAfterGUI(Rect position, UnityEditor.SerializedProperty property, GUIContent label) { } /// /// Overriding occurs just like OnGUI. Once per group, attribute with higher priority first /// /// Null if not overrided public virtual float? OverrideHeight() { return null; } #endif } }