LevelStyle.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System.Collections.Generic;
  2. using UnityEngine;
  3. namespace XCharts.Runtime
  4. {
  5. [System.Serializable]
  6. public class Level : ChildComponent
  7. {
  8. [SerializeField][Since("v3.10.0")] private int m_Depth = 0;
  9. [SerializeField] private LabelStyle m_Label = new LabelStyle();
  10. [SerializeField] private LabelStyle m_UpperLabel = new LabelStyle();
  11. [SerializeField][Since("v3.10.0")] private LineStyle m_LineStyle = new LineStyle();
  12. [SerializeField] private ItemStyle m_ItemStyle = new ItemStyle();
  13. /// <summary>
  14. /// the depth of level.
  15. /// ||层级深度。
  16. /// </summary>
  17. public int depth { get { return m_Depth; } set { m_Depth = value; } }
  18. /// <summary>
  19. /// the label style of level.
  20. /// ||文本标签样式。
  21. /// </summary>
  22. public LabelStyle label { get { return m_Label; } }
  23. /// <summary>
  24. /// the upper label style of level.
  25. /// ||上方的文本标签样式。
  26. /// </summary>
  27. public LabelStyle upperLabel { get { return m_UpperLabel; } }
  28. /// <summary>
  29. /// the line style of level.
  30. /// ||线条样式。
  31. /// </summary>
  32. public LineStyle lineStyle { get { return m_LineStyle; } }
  33. /// <summary>
  34. /// the item style of level.
  35. /// ||数据项样式。
  36. /// </summary>
  37. public ItemStyle itemStyle { get { return m_ItemStyle; } }
  38. }
  39. [System.Serializable]
  40. public class LevelStyle : ChildComponent
  41. {
  42. [SerializeField] private bool m_Show = false;
  43. [SerializeField] private List<Level> m_Levels = new List<Level>() { new Level() };
  44. /// <summary>
  45. /// 是否启用LevelStyle
  46. /// </summary>
  47. public bool show { get { return m_Show; } set { m_Show = value; } }
  48. /// <summary>
  49. /// 各层节点对应的配置。当enableLevels为true时生效,levels[0]对应的第一层的配置,levels[1]对应第二层,依次类推。当levels中没有对应层时用默认的设置。
  50. /// </summary>
  51. public List<Level> levels { get { return m_Levels; } }
  52. }
  53. }