Files
XCharts/Editor/MainComponents/RadarCoordEditor.cs

51 lines
1.7 KiB
C#
Raw Normal View History

2021-11-23 13:20:07 +08:00
using UnityEditor;
using UnityEngine;
2022-02-19 22:37:57 +08:00
using XCharts.Runtime;
2021-11-23 13:20:07 +08:00
2021-12-24 13:33:09 +08:00
namespace XCharts.Editor
2021-11-23 13:20:07 +08:00
{
[ComponentEditor(typeof(RadarCoord))]
public class RadarCoordEditor : MainComponentEditor<RadarCoord>
{
public override void OnInspectorGUI()
{
++EditorGUI.indentLevel;
PropertyField("m_Shape");
PropertyField("m_PositionType");
PropertyTwoFiled("m_Center");
PropertyField("m_Radius");
PropertyField("m_SplitNumber");
PropertyField("m_StartAngle");
2021-11-23 13:20:07 +08:00
PropertyField("m_CeilRate");
PropertyField("m_IsAxisTooltip");
PropertyField("m_OutRangeColor");
PropertyField("m_ConnectCenter");
PropertyField("m_LineGradient");
PropertyField("m_AxisLine");
2022-01-22 21:08:26 +08:00
PropertyField("m_AxisName");
2021-11-23 13:20:07 +08:00
PropertyField("m_SplitLine");
PropertyField("m_SplitArea");
2022-07-17 20:57:38 +08:00
PropertyListField("m_IndicatorList");
2021-11-23 13:20:07 +08:00
--EditorGUI.indentLevel;
}
}
[CustomPropertyDrawer(typeof(RadarCoord.Indicator), true)]
public class RadarIndicatorDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Indicator"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
2022-03-09 07:26:15 +08:00
if (MakeComponentFoldout(prop, "", true))
2021-11-23 13:20:07 +08:00
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Name");
PropertyField(prop, "m_Min");
PropertyField(prop, "m_Max");
PropertyTwoFiled(prop, "m_Range");
--EditorGUI.indentLevel;
}
}
}
}