Açıklama Yok
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.

AxisMinorTick.cs 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using UnityEngine;
  2. namespace XCharts.Runtime
  3. {
  4. /// <summary>
  5. /// Settings related to axis minor tick.
  6. /// |坐标轴次刻度相关设置。注意:次刻度无法在类目轴中使用。
  7. /// </summary>
  8. [System.Serializable]
  9. [Since("v3.2.0")]
  10. public class AxisMinorTick : BaseLine
  11. {
  12. [SerializeField] protected int m_SplitNumber = 5;
  13. [SerializeField] private bool m_AutoColor;
  14. /// <summary>
  15. /// Number of segments that the axis is split into.
  16. /// |分隔线之间分割的刻度数。
  17. /// </summary>
  18. public int splitNumber
  19. {
  20. get { return m_SplitNumber; }
  21. set { if (PropertyUtil.SetStruct(ref m_SplitNumber, value)) SetAllDirty(); }
  22. }
  23. public bool autoColor { get { return m_AutoColor; } set { m_AutoColor = value; } }
  24. public override bool vertsDirty { get { return m_VertsDirty || m_LineStyle.anyDirty; } }
  25. public override void ClearVerticesDirty()
  26. {
  27. base.ClearVerticesDirty();
  28. m_LineStyle.ClearVerticesDirty();
  29. }
  30. public static AxisMinorTick defaultMinorTick
  31. {
  32. get
  33. {
  34. var tick = new AxisMinorTick
  35. {
  36. m_Show = false
  37. };
  38. return tick;
  39. }
  40. }
  41. public AxisMinorTick Clone()
  42. {
  43. var axisTick = new AxisMinorTick();
  44. axisTick.show = show;
  45. axisTick.splitNumber = splitNumber;
  46. axisTick.autoColor = autoColor;
  47. axisTick.lineStyle = lineStyle.Clone();
  48. return axisTick;
  49. }
  50. public void Copy(AxisMinorTick axisTick)
  51. {
  52. show = axisTick.show;
  53. splitNumber = axisTick.splitNumber;
  54. autoColor = axisTick.autoColor;
  55. lineStyle.Copy(axisTick.lineStyle);
  56. }
  57. }
  58. }