WidgetItemData.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using Fort23.Core;
  2. using Fort23.UTool;
  3. using UnityEngine.UI;
  4. using UnityEngine;
  5. using System.Collections.Generic;
  6. using TMPro;
  7. namespace Fort23.Mono
  8. {
  9. public partial class WidgetItem
  10. {
  11. #region 自定义数据
  12. private Button _btnClick;
  13. public Button btnClick
  14. {
  15. get{
  16. if (_btnClick == null)
  17. {
  18. _btnClick = GetUIUnit<Button>("btnClick");
  19. }
  20. return _btnClick;
  21. }
  22. }
  23. private MyImage _bg;
  24. public MyImage bg
  25. {
  26. get{
  27. if (_bg == null)
  28. {
  29. _bg = GetUIUnit<MyImage>("bg");
  30. }
  31. return _bg;
  32. }
  33. }
  34. private MyImage _icon;
  35. public MyImage icon
  36. {
  37. get{
  38. if (_icon == null)
  39. {
  40. _icon = GetUIUnit<MyImage>("icon");
  41. }
  42. return _icon;
  43. }
  44. }
  45. private TextMeshProUGUI _num;
  46. public TextMeshProUGUI num
  47. {
  48. get{
  49. if (_num == null)
  50. {
  51. _num = GetUIUnit<TextMeshProUGUI>("num");
  52. }
  53. return _num;
  54. }
  55. }
  56. private GameObject _numObj;
  57. public GameObject numObj
  58. {
  59. get{
  60. if (_numObj == null)
  61. {
  62. _numObj = GetUIUnit<GameObject>("numObj");
  63. }
  64. return _numObj;
  65. }
  66. }
  67. #endregion 自定义数据结束
  68. public override async CTask SetUIGameObject(GameObject gObjectPoolInterface)
  69. {
  70. await base.SetUIGameObject(gObjectPoolInterface);
  71. Init();
  72. }
  73. }
  74. }