RadarCoordEditor.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using UnityEditor;
  2. using UnityEngine;
  3. using XCharts.Runtime;
  4. namespace XCharts.Editor
  5. {
  6. [ComponentEditor(typeof(RadarCoord))]
  7. public class RadarCoordEditor : MainComponentEditor<RadarCoord>
  8. {
  9. public override void OnInspectorGUI()
  10. {
  11. ++EditorGUI.indentLevel;
  12. PropertyField("m_Shape");
  13. PropertyField("m_PositionType");
  14. PropertyTwoFiled("m_Center");
  15. PropertyField("m_Radius");
  16. PropertyField("m_SplitNumber");
  17. PropertyField("m_StartAngle");
  18. PropertyField("m_CeilRate");
  19. PropertyField("m_IsAxisTooltip");
  20. PropertyField("m_OutRangeColor");
  21. PropertyField("m_ConnectCenter");
  22. PropertyField("m_LineGradient");
  23. PropertyField("m_AxisLine");
  24. PropertyField("m_AxisName");
  25. PropertyField("m_SplitLine");
  26. PropertyField("m_SplitArea");
  27. PropertyListField("m_IndicatorList");
  28. --EditorGUI.indentLevel;
  29. }
  30. }
  31. [CustomPropertyDrawer(typeof(RadarCoord.Indicator), true)]
  32. public class RadarIndicatorDrawer : BasePropertyDrawer
  33. {
  34. public override string ClassName { get { return "Indicator"; } }
  35. public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
  36. {
  37. base.OnGUI(pos, prop, label);
  38. if (MakeComponentFoldout(prop, "", true))
  39. {
  40. ++EditorGUI.indentLevel;
  41. PropertyField(prop, "m_Name");
  42. PropertyField(prop, "m_Min");
  43. PropertyField(prop, "m_Max");
  44. PropertyTwoFiled(prop, "m_Range");
  45. --EditorGUI.indentLevel;
  46. }
  47. }
  48. }
  49. }