HeroHpWidgetData.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using Fort23.Core;
  2. using Fort23.UTool;
  3. using UnityEngine.UI;
  4. using UnityEngine;
  5. using System.Collections.Generic;
  6. namespace Fort23.Mono
  7. {
  8. public partial class HeroHpWidget
  9. {
  10. #region 自定义数据
  11. private MyImage _hp;
  12. public MyImage hp
  13. {
  14. get{
  15. if (_hp == null)
  16. {
  17. _hp = GetUIUnit<MyImage>("hp");
  18. }
  19. return _hp;
  20. }
  21. }
  22. private GameObject _jy;
  23. public GameObject jy
  24. {
  25. get{
  26. if (_jy == null)
  27. {
  28. _jy = GetUIUnit<GameObject>("jy");
  29. }
  30. return _jy;
  31. }
  32. }
  33. private RectTransform _bg;
  34. public RectTransform bg
  35. {
  36. get{
  37. if (_bg == null)
  38. {
  39. _bg = GetUIUnit<RectTransform>("bg");
  40. }
  41. return _bg;
  42. }
  43. }
  44. private GameObject _ShieldsRoot;
  45. public GameObject ShieldsRoot
  46. {
  47. get{
  48. if (_ShieldsRoot == null)
  49. {
  50. _ShieldsRoot = GetUIUnit<GameObject>("ShieldsRoot");
  51. }
  52. return _ShieldsRoot;
  53. }
  54. }
  55. private MyImage _shield;
  56. public MyImage shield
  57. {
  58. get{
  59. if (_shield == null)
  60. {
  61. _shield = GetUIUnit<MyImage>("shield");
  62. }
  63. return _shield;
  64. }
  65. }
  66. private RectTransform _buffRoot;
  67. public RectTransform buffRoot
  68. {
  69. get{
  70. if (_buffRoot == null)
  71. {
  72. _buffRoot = GetUIUnit<RectTransform>("buffRoot");
  73. }
  74. return _buffRoot;
  75. }
  76. }
  77. #endregion 自定义数据结束
  78. public override async CTask SetUIGameObject(GameObject gObjectPoolInterface)
  79. {
  80. await base.SetUIGameObject(gObjectPoolInterface);
  81. Init();
  82. }
  83. }
  84. }