Geen omschrijving
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.

EmphasisStyle.cs 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using UnityEngine;
  2. namespace XCharts.Runtime
  3. {
  4. /// <summary>
  5. /// Configurations of emphasis state.
  6. /// |高亮状态样式。
  7. /// </summary>
  8. [System.Serializable]
  9. [Since("v3.2.0")]
  10. public class EmphasisStyle : StateStyle, ISerieExtraComponent, ISerieDataComponent
  11. {
  12. /// <summary>
  13. /// focus type.
  14. /// |聚焦类型。
  15. /// </summary>
  16. public enum FocusType
  17. {
  18. /// <summary>
  19. /// Do not fade out other data, it's by default.
  20. /// |不淡出其它图形,默认使用该配置。
  21. /// </summary>
  22. None,
  23. /// <summary>
  24. /// Only focus (not fade out) the element of the currently highlighted data.
  25. /// |只聚焦(不淡出)当前高亮的数据的图形。
  26. /// </summary>
  27. Self,
  28. /// <summary>
  29. /// Focus on all elements of the series which the currently highlighted data belongs to.
  30. /// |聚焦当前高亮的数据所在的系列的所有图形。
  31. /// </summary>
  32. Series
  33. }
  34. /// <summary>
  35. /// blur scope.
  36. /// |淡出范围。
  37. /// </summary>
  38. public enum BlurScope
  39. {
  40. /// <summary>
  41. /// coordinate system.
  42. /// |淡出范围为坐标系,默认使用该配置。
  43. /// </summary>
  44. GridCoord,
  45. /// <summary>
  46. /// series.
  47. /// |淡出范围为系列。
  48. /// </summary>
  49. Series,
  50. /// <summary>
  51. /// global.
  52. /// |淡出范围为全局。
  53. /// </summary>
  54. Global
  55. }
  56. [SerializeField] private float m_Scale = 1.1f;
  57. [SerializeField] private FocusType m_Focus = FocusType.None;
  58. [SerializeField] private BlurScope m_BlurScope = BlurScope.GridCoord;
  59. /// <summary>
  60. /// Whether to scale to highlight the data in emphasis state.
  61. /// |高亮时的缩放倍数。
  62. /// </summary>
  63. public float scale
  64. {
  65. get { return m_Scale; }
  66. set { if (PropertyUtil.SetStruct(ref m_Scale, value)) SetVerticesDirty(); }
  67. }
  68. /// <summary>
  69. /// When the data is highlighted, whether to fade out of other data to focus the highlighted.
  70. /// |在高亮图形时,是否淡出其它数据的图形已达到聚焦的效果。
  71. /// </summary>
  72. public FocusType focus
  73. {
  74. get { return m_Focus; }
  75. set { if (PropertyUtil.SetStruct(ref m_Focus, value)) SetVerticesDirty(); }
  76. }
  77. /// <summary>
  78. /// The range of fade out when focus is enabled.
  79. /// |在开启focus的时候,可以通过blurScope配置淡出的范围。
  80. /// </summary>
  81. public BlurScope blurScope
  82. {
  83. get { return m_BlurScope; }
  84. set { if (PropertyUtil.SetStruct(ref m_BlurScope, value)) SetVerticesDirty(); }
  85. }
  86. }
  87. }