0.2版本,重构代码,增加Editor

This commit is contained in:
monitor1394
2019-05-11 04:33:54 +08:00
parent ba1e2c29a2
commit 60c3f7b036
121 changed files with 81427 additions and 21465 deletions

View File

@@ -0,0 +1,26 @@
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);
}
}
}