mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-20 07:20:08 +00:00
[feature][serie] support EmphasisStle,BlurStyle and SelectStyle
This commit is contained in:
54
Editor/ChildComponents/StateStyleDrawer.cs
Normal file
54
Editor/ChildComponents/StateStyleDrawer.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(StateStyle), true)]
|
||||
public class StateStyleDrawer : BasePropertyDrawer
|
||||
{
|
||||
public override string ClassName { get { return "StateStyle"; } }
|
||||
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
base.OnGUI(pos, prop, label);
|
||||
if (MakeComponentFoldout(prop, "m_Show", true))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
OnCustomGUI(prop);
|
||||
PropertyField(prop, "m_ItemStyle");
|
||||
PropertyField(prop, "m_Label");
|
||||
PropertyField(prop, "m_LabelLine");
|
||||
PropertyField(prop, "m_LineStyle");
|
||||
PropertyField(prop, "m_AreaStyle");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnCustomGUI(SerializedProperty prop) { }
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(EmphasisStyle), true)]
|
||||
public class EmphasisStyleDrawer : StateStyleDrawer
|
||||
{
|
||||
public override string ClassName { get { return "EmphasisStyle"; } }
|
||||
protected override void OnCustomGUI(SerializedProperty prop)
|
||||
{
|
||||
PropertyField(prop, "m_Scale");
|
||||
PropertyField(prop, "m_Focus");
|
||||
PropertyField(prop, "m_BlurScope");
|
||||
}
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(BlurStyle), true)]
|
||||
public class BlurStyleDrawer : StateStyleDrawer
|
||||
{
|
||||
public override string ClassName { get { return "BlurStyle"; } }
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(SelectStyle), true)]
|
||||
public class SelectStyleDrawer : StateStyleDrawer
|
||||
{
|
||||
public override string ClassName { get { return "SelectStyle"; } }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user