mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-22 17:00:08 +00:00
3.0 - unitypackage
This commit is contained in:
60
Editor/ChildComponents/LineDrawer.cs
Normal file
60
Editor/ChildComponents/LineDrawer.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace XCharts.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(BaseLine), true)]
|
||||
public class BaseLineDrawer : BasePropertyDrawer
|
||||
{
|
||||
public override string ClassName { get { return "Line"; } }
|
||||
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
base.OnGUI(pos, prop, label);
|
||||
if (MakeComponentFoldout(prop, "m_Show"))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
DrawExtendeds(prop);
|
||||
PropertyField(prop, "m_LineStyle");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(AxisLine), true)]
|
||||
public class AxisLineDrawer : BaseLineDrawer
|
||||
{
|
||||
public override string ClassName { get { return "AxisLine"; } }
|
||||
protected override void DrawExtendeds(SerializedProperty prop)
|
||||
{
|
||||
base.DrawExtendeds(prop);
|
||||
PropertyField(prop, "m_OnZero");
|
||||
PropertyField(prop, "m_ShowArrow");
|
||||
PropertyField(prop, "m_Arrow");
|
||||
}
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(AxisSplitLine), true)]
|
||||
public class AxisSplitLineDrawer : BaseLineDrawer
|
||||
{
|
||||
public override string ClassName { get { return "SplitLine"; } }
|
||||
protected override void DrawExtendeds(SerializedProperty prop)
|
||||
{
|
||||
base.DrawExtendeds(prop);
|
||||
PropertyField(prop, "m_Interval");
|
||||
}
|
||||
}
|
||||
[CustomPropertyDrawer(typeof(AxisTick), true)]
|
||||
public class AxisTickDrawer : BaseLineDrawer
|
||||
{
|
||||
public override string ClassName { get { return "AxisTick"; } }
|
||||
protected override void DrawExtendeds(SerializedProperty prop)
|
||||
{
|
||||
base.DrawExtendeds(prop);
|
||||
PropertyField(prop, "m_AlignWithLabel");
|
||||
PropertyField(prop, "m_Inside");
|
||||
PropertyField(prop, "m_ShowStartTick");
|
||||
PropertyField(prop, "m_ShowEndTick");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user