Bladeren bron

活动刷新

zhaoyang 2 jaren geleden
bovenliggende
commit
9cbd81de23

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs

@@ -153,5 +153,7 @@ namespace GFGGame
 
         //引导界面关闭
         public const string GUIDE_VIEW_HIDE = "GUIDE_VIEW_HIDE";
+        //每日重置
+        public const string RESET_DAILY_DATA = "RESET_DAILY_DATA";
     }
 }

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Data/ActivityDataManager.cs

@@ -9,6 +9,7 @@ namespace GFGGame
             luckyBoxActBonusState.Clear();
             allPlayTimes = 0;
             lastActLuckyBoxId = 0;
+            lastActLimitChargeId = 0;
         }
 
         /**********************************************************活动*************************************************/
@@ -29,6 +30,7 @@ namespace GFGGame
             return 0;
         }
         /**********************************************************限时累充*************************************************/
+        public int lastActLimitChargeId = 0;
         private int _actLimitChargeId = 0;
         /// <summary>
         /// 当前限时累充活动id

+ 7 - 2
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -19,7 +19,7 @@ namespace GFGGame
         private const int swipeDistance = 100;
         private bool isOpen = false;
 
-        private int _actLimitChargeId = 0;
+
         private List<AdCfg> _adIds = new List<AdCfg>();
         private Vector2 _startPos;
         private Vector2 _endPos;
@@ -191,6 +191,11 @@ namespace GFGGame
             EventAgent.AddEventListener(ConstMessage.STORY_LEVEL_CHANGE, CheckFunOpen);
             EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
             EventAgent.AddEventListener(ConstMessage.CHANGE_ROLE_HEAD, UpdateHead);
+            EventAgent.AddEventListener(ConstMessage.RESET_DAILY_DATA, ResetDailyData);
+        }
+        private void ResetDailyData()
+        {
+            ViewManager.Show<MainUIView>();
         }
 
         protected override void OnShown()
@@ -819,7 +824,7 @@ namespace GFGGame
 
             List<int> actListChargeIds = ActivityGlobalDataManager.Instance.GetActivityInfoIdsByType(ConstLimitTimeActivityType.ActLimitChargeId);
             int actLimitChargeId = actListChargeIds.Count > 0 ? actListChargeIds[0] : 0;
-            if (_actLimitChargeId != actLimitChargeId)
+            if (ActivityDataManager.Instance.lastActLimitChargeId != actLimitChargeId)
             {
                 ActivityDataManager.Instance.actLimitChargeId = actLimitChargeId;
                 _ui.m_btnDailyWelfare.target.visible = actLimitChargeId > 0 ||