DataZoomEditor.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using UnityEditor;
  2. using XCharts.Runtime;
  3. namespace XCharts.Editor
  4. {
  5. [ComponentEditor(typeof(DataZoom))]
  6. public class DataZoomEditor : MainComponentEditor<DataZoom>
  7. {
  8. public override void OnInspectorGUI()
  9. {
  10. var m_SupportInside = baseProperty.FindPropertyRelative("m_SupportInside");
  11. var m_SupportSlider = baseProperty.FindPropertyRelative("m_SupportSlider");
  12. var m_SupportMarquee = baseProperty.FindPropertyRelative("m_SupportMarquee");
  13. var m_Start = baseProperty.FindPropertyRelative("m_Start");
  14. var m_End = baseProperty.FindPropertyRelative("m_End");
  15. var m_MinShowNum = baseProperty.FindPropertyRelative("m_MinShowNum");
  16. ++EditorGUI.indentLevel;
  17. PropertyField("m_Orient");
  18. PropertyField("m_SupportInside");
  19. if (m_SupportInside.boolValue)
  20. {
  21. PropertyField("m_SupportInsideScroll");
  22. PropertyField("m_SupportInsideDrag");
  23. }
  24. PropertyField(m_SupportSlider);
  25. PropertyField(m_SupportMarquee);
  26. PropertyField("m_ZoomLock");
  27. PropertyField("m_ScrollSensitivity");
  28. PropertyField("m_RangeMode");
  29. PropertyField(m_Start);
  30. PropertyField(m_End);
  31. PropertyField(m_MinShowNum);
  32. if (m_Start.floatValue < 0) m_Start.floatValue = 0;
  33. if (m_End.floatValue > 100) m_End.floatValue = 100;
  34. if (m_MinShowNum.intValue < 0) m_MinShowNum.intValue = 0;
  35. if (m_SupportSlider.boolValue)
  36. {
  37. PropertyField("m_ShowDataShadow");
  38. PropertyField("m_ShowDetail");
  39. PropertyField("m_BackgroundColor");
  40. PropertyField("m_BorderWidth");
  41. PropertyField("m_BorderColor");
  42. PropertyField("m_FillerColor");
  43. PropertyField("m_Left");
  44. PropertyField("m_Right");
  45. PropertyField("m_Top");
  46. PropertyField("m_Bottom");
  47. PropertyField("m_LineStyle");
  48. PropertyField("m_AreaStyle");
  49. PropertyField("m_LabelStyle");
  50. PropertyListField("m_XAxisIndexs", true);
  51. PropertyListField("m_YAxisIndexs", true);
  52. }
  53. else
  54. {
  55. PropertyListField("m_XAxisIndexs", true);
  56. PropertyListField("m_YAxisIndexs", true);
  57. }
  58. PropertyField("m_MarqueeStyle");
  59. --EditorGUI.indentLevel;
  60. }
  61. }
  62. }