暫無描述
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.

UIComponentTheme.cs 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. namespace XCharts.Runtime
  5. {
  6. [Serializable]
  7. public class UIComponentTheme : ChildComponent
  8. {
  9. [SerializeField] private bool m_Show = true;
  10. [SerializeField] private Theme m_SharedTheme;
  11. [SerializeField] private bool m_TransparentBackground = false;
  12. public bool show { get { return m_Show; } }
  13. /// <summary>
  14. /// the theme of chart.
  15. /// |主题类型。
  16. /// </summary>
  17. public ThemeType themeType
  18. {
  19. get { return sharedTheme.themeType; }
  20. }
  21. /// <summary>
  22. /// theme name.
  23. /// |主题名字。
  24. /// </summary>
  25. public string themeName
  26. {
  27. get { return sharedTheme.themeName; }
  28. }
  29. /// <summary>
  30. /// the asset of theme.
  31. /// |主题配置。
  32. /// </summary>
  33. public Theme sharedTheme
  34. {
  35. get { return m_SharedTheme; }
  36. set { m_SharedTheme = value; SetAllDirty(); }
  37. }
  38. /// <summary>
  39. /// the background color of chart.
  40. /// |背景颜色。
  41. /// </summary>
  42. public Color32 backgroundColor
  43. {
  44. get
  45. {
  46. if (m_TransparentBackground) return ColorUtil.clearColor32;
  47. else return sharedTheme.backgroundColor;
  48. }
  49. }
  50. }
  51. }