zhaoyang пре 3 година
родитељ
комит
b053c48aaa
1 измењених фајлова са 11 додато и 1 уклоњено
  1. 11 1
      GameClient/Assets/Game/HotUpdate/Views/Notice/NoticeView.cs

+ 11 - 1
GameClient/Assets/Game/HotUpdate/Views/Notice/NoticeView.cs

@@ -36,10 +36,13 @@ namespace GFGGame
             _ui.m_listNotice.itemRenderer = ListNoticeItemRender;
             _ui.m_listNotice.itemRenderer = ListNoticeItemRender;
 
 
             _ui.m_c1.onChanged.Add(OnCtrlChange);
             _ui.m_c1.onChanged.Add(OnCtrlChange);
+
+        }
+        protected override void AddEventListener()
+        {
             EventAgent.AddEventListener(ConstMessage.NOTICE_SYSTOM_ADD, OnCtrlChange);
             EventAgent.AddEventListener(ConstMessage.NOTICE_SYSTOM_ADD, OnCtrlChange);
             EventAgent.AddEventListener(ConstMessage.NOTICE_SYSTOM_REMOVE, OnCtrlChange);
             EventAgent.AddEventListener(ConstMessage.NOTICE_SYSTOM_REMOVE, OnCtrlChange);
         }
         }
-
         protected override void OnShown()
         protected override void OnShown()
         {
         {
             base.OnShown();
             base.OnShown();
@@ -53,6 +56,11 @@ namespace GFGGame
         {
         {
             base.OnHide();
             base.OnHide();
         }
         }
+        protected override void RemoveEventListener()
+        {
+            EventAgent.RemoveEventListener(ConstMessage.NOTICE_SYSTOM_ADD, OnCtrlChange);
+            EventAgent.RemoveEventListener(ConstMessage.NOTICE_SYSTOM_REMOVE, OnCtrlChange);
+        }
         private void OnCtrlChange()
         private void OnCtrlChange()
         {
         {
             if (_ui.m_c1.selectedIndex == 0)
             if (_ui.m_c1.selectedIndex == 0)
@@ -72,6 +80,7 @@ namespace GFGGame
             UI_ListActivityItem item = UI_ListActivityItem.Proxy(obj);
             UI_ListActivityItem item = UI_ListActivityItem.Proxy(obj);
             item.m_loaShow.url = ResPathUtil.GetActivityPath("");
             item.m_loaShow.url = ResPathUtil.GetActivityPath("");
             item.target.data = index;
             item.target.data = index;
+            UI_ListActivityItem.ProxyEnd();
         }
         }
 
 
         private void OnListActivityClick(EventContext context)
         private void OnListActivityClick(EventContext context)
@@ -96,6 +105,7 @@ namespace GFGGame
                 item.m_btnGo.onClick.Add(OnListNoticeBtnGoClick);
                 item.m_btnGo.onClick.Add(OnListNoticeBtnGoClick);
             }
             }
             item.m_btnGo.data = noticeInfo;
             item.m_btnGo.data = noticeInfo;
+            UI_ListNoticeItem.ProxyEnd();
         }
         }
         private async void OnListNoticeBtnGoClick(EventContext context)
         private async void OnListNoticeBtnGoClick(EventContext context)
         {
         {