Explorar el Código

feat 七日活动修改

Jae hace 2 años
padre
commit
42520abbeb

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Data/ActivityDay7DataManager.cs

@@ -8,7 +8,7 @@ namespace GFGGame
         {
             //获取7日任务活动
             var activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfoOneByType(ActivityType.Day7);
-            return activityInfo == null ? 0 : TimeUtil.GetDayByTime(activityInfo.StartTime, activityInfo.EndTime);
+            return activityInfo == null ? 0 : TimeUtil.GetDayByTime(activityInfo.StartTime, TimeHelper.ServerNow());
         }
 
         public long GetScore()

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Data/ActivityGlobalDataManager.cs

@@ -101,7 +101,7 @@ namespace GFGGame
         {
             var activityInfoIds = GetActivityInfoIdsByType(activityType);
             return activityInfoIds.Select(GetActivityInfo).FirstOrDefault(activityInfo =>
-                activityInfo != null && activityInfo.EndTime <= TimeHelper.ServerNow());
+                activityInfo != null && activityInfo.EndTime >TimeHelper.ServerNow());
         }
 
         //添加活动奖励获取数据

+ 4 - 1
GameClient/Assets/Game/HotUpdate/Views/ActivityDay7/ActivityDay7View.cs

@@ -1,3 +1,4 @@
+using System;
 using System.Collections.Generic;
 using ET;
 using FairyGUI;
@@ -54,7 +55,9 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            onClickDayIndex = ActivityDay7DataManager.Instance.GetActivityDay7Day() - 1;
+            var min = Math.Min(Activity7DaysTaskCfgArray.Instance.dataArray.Length,
+                ActivityDay7DataManager.Instance.GetActivityDay7Day());
+            onClickDayIndex = Math.Max(0, min - 1);
             SetScoreList();
             SetScore();
             SetDayList();