LuckyBoxNewCardView.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using ET;
  2. using FairyGUI;
  3. using UI.LuckyBox;
  4. using UnityEngine;
  5. namespace GFGGame
  6. {
  7. public class LuckyBoxNewCardView : BaseWindow
  8. {
  9. private UI_LuckyBoxNewCardUI _ui;
  10. public override void Dispose()
  11. {
  12. if (_ui != null)
  13. {
  14. _ui.Dispose();
  15. _ui = null;
  16. }
  17. base.Dispose();
  18. }
  19. protected override void OnInit()
  20. {
  21. base.OnInit();
  22. packageName = UI_LuckyBoxNewCardUI.PACKAGE_NAME;
  23. _ui = UI_LuckyBoxNewCardUI.Create();
  24. this.viewCom = _ui.target;
  25. isfullScreen = true;
  26. _ui.m_loaBg.onClick.Add(this.Hide);
  27. }
  28. protected override void AddEventListener()
  29. {
  30. base.AddEventListener();
  31. }
  32. protected override void OnShown()
  33. {
  34. base.OnShown();
  35. int cardId = (int)this.viewData;
  36. ItemCfg cfg = ItemCfgArray.Instance.GetCfg(cardId);
  37. _ui.m_loaBg.url = ResPathUtil.GetCardPath(cfg.res);
  38. }
  39. protected override void OnHide()
  40. {
  41. base.OnHide();
  42. }
  43. protected override void RemoveEventListener()
  44. {
  45. base.RemoveEventListener();
  46. }
  47. }
  48. }