zhaoyang 2 år sedan
förälder
incheckning
cc8407c21e
1 ändrade filer med 10 tillägg och 10 borttagningar
  1. 10 10
      GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxActivityView.cs

+ 10 - 10
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxActivityView.cs

@@ -59,7 +59,7 @@ namespace GFGGame
         protected override void AddEventListener()
         {
             base.AddEventListener();
-            EventAgent.AddEventListener(ConstMessage.ACTIVITY_LUCKY_BOX, UpdateListItemData);
+            EventAgent.AddEventListener(ConstMessage.ACTIVITY_LUCKY_BOX, UpdateView);
             EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
 
         }
@@ -77,7 +77,6 @@ namespace GFGGame
             UpGiftBox();
             Timers.inst.Add(1, 0, UpdateTime);
             UpdateView();
-            UpdateListItemData();
             UpdateRedDot();
         }
         private void UpdateTime(object param = null)
@@ -105,10 +104,9 @@ namespace GFGGame
             //=====限时礼包倒计时END
         }
 
-        private void UpdateView()
+        private void UpdateListItemData()
         {
-            _ui.m_txtCount.SetVar("value", ActivityDataManager.Instance.lastDrawCount.ToString()).FlushVars();
-            _ui.m_txtCount.SetVar("name", _luckyBoxCfg.name).FlushVars();
+
             UI_ComBox comBox = UI_ComBox.Proxy(_ui.m_comBox.target);
 
             LuckyBoxDataManager.Instance.InitData(_luckyBoxCfg.id);
@@ -141,8 +139,10 @@ namespace GFGGame
             comBox.target.data = _luckyBoxCfg.id;
 
             UI_ComBox.ProxyEnd();
+
+            UpdateListItemData();
         }
-        private void UpdateListItemData()
+        private void UpdateView()
         {
             UI_ComBox comBox = UI_ComBox.Proxy(_ui.m_comBox.target);
             LuckyBoxDataManager.Instance.GetOwnedCount(_luckyBoxCfg.id, out int count, out int totalCount);
@@ -151,14 +151,14 @@ namespace GFGGame
             int boughtCount = GameGlobal.myNumericComponent.GetAsInt(_luckyBoxCfg.numericType);
             comBox.m_txtRemainTimes.text = string.Format("今日剩余次数:{0}", _luckyBoxCfg.maxCount - boughtCount);
             UI_ComBox.ProxyEnd();
+            _ui.m_txtCount.SetVar("value", ActivityDataManager.Instance.lastDrawCount.ToString()).FlushVars();
+            _ui.m_txtCount.SetVar("name", _luckyBoxCfg.name).FlushVars();
         }
         private void UpGiftBox()
         {
-            var activityInfoByTypeList =
-                ActivityGlobalDataManager.Instance.GetActivityInfoByType(ActivityType.XSLB3);
+            var activityInfoByTypeList = ActivityGlobalDataManager.Instance.GetActivityInfoByType(ActivityType.XSLB3);
 
-            var list = activityInfoByTypeList
-                .Where(a => a.EndTime > TimeInfo.Instance.ServerNow()).ToList();
+            var list = activityInfoByTypeList.Where(a => a.EndTime > TimeInfo.Instance.ServerNow()).ToList();
             if (list.Count == 0)
             {
                 _ui.m_comBagTime.target.visible = false;