MatchingCompetitionGatheringView.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using System;
  2. using System.Collections.Generic;
  3. using ET;
  4. using FairyGUI;
  5. using UI.MatchingCompetition;
  6. using UnityEngine;
  7. namespace GFGGame
  8. {
  9. //搭配赛集合期间
  10. class MatchingCompetitionGatheringView : BaseWindow
  11. {
  12. private UI_MatchingCompetitionGatheringUI _ui;
  13. private ValueBarController _valueBarController;
  14. private int SuitID;
  15. private EffectUI _effectUI1;
  16. public override void Dispose()
  17. {
  18. EffectUIPool.Recycle(_effectUI1);
  19. _effectUI1 = null;
  20. if (_valueBarController != null)
  21. {
  22. _valueBarController.Dispose();
  23. _valueBarController = null;
  24. }
  25. if (_ui != null)
  26. {
  27. _ui.Dispose();
  28. }
  29. _ui = null;
  30. base.Dispose();
  31. }
  32. protected override void OnInit()
  33. {
  34. base.OnInit();
  35. packageName = UI_MatchingCompetitionGatheringUI.PACKAGE_NAME;
  36. _ui = UI_MatchingCompetitionGatheringUI.Create();
  37. this.viewCom = _ui.target;
  38. isReturnView = true;
  39. isfullScreen = true;
  40. _ui.m_BtnBack.onClick.Add(OnClickBtnBack);
  41. _ui.m_btnUploadWorks.onClick.Add(OnClickBtnUpload);
  42. _ui.m_btnShop.onClick.Add(OnClickBtnShop);
  43. _ui.m_ruleBtn.onClick.Add(MatchingCompetitionDataManager.Instance.OnClickBtnRule);
  44. }
  45. protected override void AddEventListener()
  46. {
  47. base.AddEventListener();
  48. }
  49. protected override void OnShown()
  50. {
  51. base.OnShown();
  52. _ui.m_bg.url = ResPathUtil.GetBgImgPath("gzs_fb_bj");
  53. _ui.m_c1.selectedIndex = 0;
  54. SuitID = 201030;
  55. UpdateView();
  56. Timers.inst.AddUpdate(UpdateTime);
  57. }
  58. protected override void OnHide()
  59. {
  60. DressUpObjUI dressUpObjUI = _ui.m_suitShow.data as DressUpObjUI;
  61. if (dressUpObjUI != null)
  62. {
  63. dressUpObjUI.Dispose();
  64. }
  65. _ui.m_suitShow.data = null;
  66. base.OnHide();
  67. Timers.inst.Remove(UpdateTime);
  68. }
  69. protected override void RemoveEventListener()
  70. {
  71. base.RemoveEventListener();
  72. }
  73. private void UpdateView()
  74. {
  75. if (true)
  76. {
  77. DressUpObjUI dressUpObjUI;
  78. if (_ui.m_suitShow.data == null)
  79. {
  80. _ui.m_suitShow.data = new DressUpObjUI("SceneSuitFoster");
  81. }
  82. bool showAction = SuitCfgArray.Instance.CheckSuitHasAction(SuitID) && DressUpMenuSuitDataManager.CheckSuitHasActionRes(SuitID);
  83. dressUpObjUI = _ui.m_suitShow.data as DressUpObjUI;
  84. dressUpObjUI.ResetSceneObj(100, false, true, null, false);
  85. dressUpObjUI.dressUpObj.PutOnSuitCfg(SuitID, showAction, new int[] { ConstDressUpItemType.BEI_JING }, false, false);
  86. dressUpObjUI.UpdateWrapper(_ui.m_suitShow);
  87. }
  88. }
  89. private void UpdateTime(object param = null)
  90. {
  91. }
  92. private void OnClickBtnBack()
  93. {
  94. ViewManager.GoBackFrom(typeof(MatchingCompetitionGatheringView).FullName);
  95. }
  96. private void OnClickBtnUpload()
  97. {
  98. ViewManager.Show<DressUpView>(2, false);
  99. }
  100. private void OnClickBtnShop()
  101. {
  102. ViewManager.Show<MatchingCompetitionUpLoadView>();
  103. //ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_GIFT_BAG, ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY });
  104. }
  105. }
  106. }