Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SettingsDrawer.cs 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using UnityEditor;
  2. using UnityEngine;
  3. using XCharts.Runtime;
  4. namespace XCharts.Editor
  5. {
  6. [CustomPropertyDrawer(typeof(Settings), true)]
  7. public class SettingsDrawer : BasePropertyDrawer
  8. {
  9. public override string ClassName { get { return "Settings"; } }
  10. public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
  11. {
  12. base.OnGUI(pos, prop, label);
  13. if (MakeComponentFoldout(prop, "m_Show", false, new HeaderMenuInfo("Reset", () =>
  14. {
  15. var chart = prop.serializedObject.targetObject as BaseChart;
  16. chart.settings.Reset();
  17. })))
  18. {
  19. ++EditorGUI.indentLevel;
  20. PropertyField(prop, "m_ReversePainter");
  21. PropertyField(prop, "m_MaxPainter");
  22. PropertyField(prop, "m_BasePainterMaterial");
  23. PropertyField(prop, "m_SeriePainterMaterial");
  24. PropertyField(prop, "m_UpperPainterMaterial");
  25. PropertyField(prop, "m_TopPainterMaterial");
  26. PropertyField(prop, "m_LineSmoothStyle");
  27. PropertyField(prop, "m_LineSmoothness");
  28. PropertyField(prop, "m_LineSegmentDistance");
  29. PropertyField(prop, "m_CicleSmoothness");
  30. PropertyField(prop, "m_AxisMaxSplitNumber");
  31. PropertyField(prop, "m_LegendIconLineWidth");
  32. PropertyListField(prop, "m_LegendIconCornerRadius", true);
  33. --EditorGUI.indentLevel;
  34. }
  35. }
  36. }
  37. }