설명 없음
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.

Padding.cs 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using System;
  2. using UnityEngine;
  3. namespace XCharts.Runtime
  4. {
  5. /// <summary>
  6. /// padding setting of item or text.
  7. /// |边距设置。
  8. /// </summary>
  9. [Serializable]
  10. public class Padding : ChildComponent
  11. {
  12. [SerializeField] protected bool m_Show = true;
  13. [SerializeField] protected float m_Top = 0;
  14. [SerializeField] protected float m_Right = 2f;
  15. [SerializeField] protected float m_Left = 2f;
  16. [SerializeField] protected float m_Bottom = 0;
  17. public Padding() { }
  18. public Padding(float top, float right, float bottom, float left)
  19. {
  20. SetPadding(top, right, bottom, left);
  21. }
  22. public void SetPadding(float top, float right, float bottom, float left)
  23. {
  24. m_Top = top;;
  25. m_Right = right;
  26. m_Bottom = bottom;
  27. m_Left = left;
  28. }
  29. /// <summary>
  30. /// show padding.
  31. /// 是否显示。
  32. /// </summary>
  33. public bool show
  34. {
  35. get { return m_Show; }
  36. set { if (PropertyUtil.SetStruct(ref m_Show, value)) SetComponentDirty(); }
  37. }
  38. /// <summary>
  39. /// padding of top.
  40. /// |顶部间距。
  41. /// </summary>
  42. public float top
  43. {
  44. get { return m_Top; }
  45. set { if (PropertyUtil.SetStruct(ref m_Top, value)) SetComponentDirty(); }
  46. }
  47. /// <summary>
  48. /// padding of right.
  49. /// |右部间距。
  50. /// </summary>
  51. public float right
  52. {
  53. get { return m_Right; }
  54. set { if (PropertyUtil.SetStruct(ref m_Right, value)) SetComponentDirty(); }
  55. }
  56. /// <summary>
  57. /// padding of bottom.
  58. /// |底部间距。
  59. /// </summary>
  60. public float bottom
  61. {
  62. get { return m_Bottom; }
  63. set { if (PropertyUtil.SetStruct(ref m_Bottom, value)) SetComponentDirty(); }
  64. }
  65. /// <summary>
  66. /// padding of left.
  67. /// |左边间距。
  68. /// </summary>
  69. public float left
  70. {
  71. get { return m_Left; }
  72. set { if (PropertyUtil.SetStruct(ref m_Left, value)) SetComponentDirty(); }
  73. }
  74. }
  75. }