using UnityEditor; using UnityEngine; using UnityEngine.UI; namespace XCharts { [CustomPropertyDrawer(typeof(Tooltip), true)] public class TooltipDrawer : PropertyDrawer { private bool m_TooltipModuleToggle = false; public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label) { Rect drawRect = pos; drawRect.height = EditorGUIUtility.singleLineHeight; SerializedProperty show = prop.FindPropertyRelative("m_Show"); ChartEditorHelper.MakeFoldout(ref drawRect, ref m_TooltipModuleToggle, "Tooltip", show); } public override float GetPropertyHeight(SerializedProperty prop, GUIContent label) { return 1 * (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing); } } }