Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

AxisLine.cs 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using UnityEngine;
  2. namespace XCharts.Runtime
  3. {
  4. /// <summary>
  5. /// Settings related to axis line.
  6. /// |坐标轴轴线。
  7. /// </summary>
  8. [System.Serializable]
  9. public class AxisLine : BaseLine
  10. {
  11. [SerializeField] private bool m_OnZero;
  12. [SerializeField] private bool m_ShowArrow;
  13. [SerializeField] private ArrowStyle m_Arrow = new ArrowStyle();
  14. /// <summary>
  15. /// When mutiple axes exists, this option can be used to specify which axis can be "onZero" to.
  16. /// |X 轴或者 Y 轴的轴线是否在另一个轴的 0 刻度上,只有在另一个轴为数值轴且包含 0 刻度时有效。
  17. /// </summary>
  18. public bool onZero
  19. {
  20. get { return m_OnZero; }
  21. set { if (PropertyUtil.SetStruct(ref m_OnZero, value)) SetVerticesDirty(); }
  22. }
  23. /// <summary>
  24. /// Whether to show the arrow symbol of axis.
  25. /// |是否显示箭头。
  26. /// </summary>
  27. public bool showArrow
  28. {
  29. get { return m_ShowArrow; }
  30. set { if (PropertyUtil.SetStruct(ref m_ShowArrow, value)) SetVerticesDirty(); }
  31. }
  32. /// <summary>
  33. /// the arrow of line.
  34. /// |轴线箭头。
  35. /// </summary>
  36. public ArrowStyle arrow
  37. {
  38. get { return m_Arrow; }
  39. set { if (PropertyUtil.SetClass(ref m_Arrow, value)) SetVerticesDirty(); }
  40. }
  41. public static AxisLine defaultAxisLine
  42. {
  43. get
  44. {
  45. var axisLine = new AxisLine
  46. {
  47. m_Show = true,
  48. m_OnZero = true,
  49. m_ShowArrow = false,
  50. m_Arrow = new ArrowStyle(),
  51. m_LineStyle = new LineStyle(LineStyle.Type.None),
  52. };
  53. return axisLine;
  54. }
  55. }
  56. public AxisLine Clone()
  57. {
  58. var axisLine = new AxisLine();
  59. axisLine.show = show;
  60. axisLine.onZero = onZero;
  61. axisLine.showArrow = showArrow;
  62. axisLine.arrow = arrow.Clone();
  63. return axisLine;
  64. }
  65. public void Copy(AxisLine axisLine)
  66. {
  67. base.Copy(axisLine);
  68. onZero = axisLine.onZero;
  69. showArrow = axisLine.showArrow;
  70. arrow.Copy(axisLine.arrow);
  71. }
  72. }
  73. }