RadarCoordEditor.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_GridIndex");
  13. PropertyField("m_Shape");
  14. PropertyField("m_PositionType");
  15. PropertyTwoFiled("m_Center");
  16. PropertyField("m_Radius");
  17. PropertyField("m_SplitNumber");
  18. PropertyField("m_StartAngle");
  19. PropertyField("m_CeilRate");
  20. PropertyField("m_IsAxisTooltip");
  21. PropertyField("m_OutRangeColor");
  22. PropertyField("m_ConnectCenter");
  23. PropertyField("m_LineGradient");
  24. PropertyField("m_AxisLine");
  25. PropertyField("m_AxisName");
  26. PropertyField("m_SplitLine");
  27. PropertyField("m_SplitArea");
  28. PropertyListField("m_IndicatorList");
  29. --EditorGUI.indentLevel;
  30. }
  31. }
  32. [CustomPropertyDrawer(typeof(RadarCoord.Indicator), true)]
  33. public class RadarIndicatorDrawer : BasePropertyDrawer
  34. {
  35. public override string ClassName { get { return "Indicator"; } }
  36. public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
  37. {
  38. base.OnGUI(pos, prop, label);
  39. if (MakeComponentFoldout(prop, "", true))
  40. {
  41. ++EditorGUI.indentLevel;
  42. PropertyField(prop, "m_Name");
  43. PropertyField(prop, "m_Min");
  44. PropertyField(prop, "m_Max");
  45. PropertyTwoFiled(prop, "m_Range");
  46. --EditorGUI.indentLevel;
  47. }
  48. }
  49. }
  50. }