mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-23 09:20:08 +00:00
[feature][serie] support EmphasisStle,BlurStyle and SelectStyle
This commit is contained in:
@@ -17,8 +17,6 @@ namespace XCharts.Editor
|
||||
PropertyField(prop, "m_Origin");
|
||||
PropertyField(prop, "m_Color");
|
||||
PropertyField(prop, "m_ToColor");
|
||||
PropertyField(prop, "m_HighlightColor");
|
||||
PropertyField(prop, "m_HighlightToColor");
|
||||
PropertyField(prop, "m_Opacity");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(Emphasis), true)]
|
||||
public class EmphasisDrawer : BasePropertyDrawer
|
||||
{
|
||||
public override string ClassName { get { return "Emphasis"; } }
|
||||
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
base.OnGUI(pos, prop, label);
|
||||
if (MakeComponentFoldout(prop, "m_Show", true))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
PropertyField(prop, "m_Label");
|
||||
PropertyField(prop, "m_LabelLine");
|
||||
PropertyField(prop, "m_ItemStyle");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(EmphasisItemStyle), true)]
|
||||
public class EmphasisItemStyleDrawer : ItemStyleDrawer
|
||||
{
|
||||
public override string ClassName { get { return "EmphasisItemStyle"; } }
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(EmphasisLabelStyle), true)]
|
||||
public class EmphasisLabelStyleDrawer : LabelStyleDrawer
|
||||
{
|
||||
public override string ClassName { get { return "EmphasisLabel"; } }
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(EmphasisLabelLine), true)]
|
||||
public class EmphasisLabelLineDrawer : LabelLineDrawer
|
||||
{
|
||||
public override string ClassName { get { return "EmphasisLabelLine"; } }
|
||||
}
|
||||
}
|
||||
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"; } }
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7de9b5e4c5d474fdd88ebb89f0924305
|
||||
guid: 3aad8ee99115742729ec5a963274fae0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
Reference in New Issue
Block a user