mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-16 13:30:10 +00:00
26 lines
846 B
C#
26 lines
846 B
C#
|
|
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);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|