From 4edbe9209657d9012680763385930e4828fd2814 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期五, 13 二月 2026 15:39:25 +0800
Subject: [PATCH] 475 时机礼包-客户端 增加同时展示类型限制

---
 Main/System/TimingGift/TimingGiftManager.cs |   47 ++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/Main/System/TimingGift/TimingGiftManager.cs b/Main/System/TimingGift/TimingGiftManager.cs
index 8f3d99a..5911077 100644
--- a/Main/System/TimingGift/TimingGiftManager.cs
+++ b/Main/System/TimingGift/TimingGiftManager.cs
@@ -38,7 +38,9 @@
     public int[] selectCtgIds;
     public int[][] selectGainItemList;
     public int limitPopCnt;
+    public int limitShowCnt;
     public int limitPopCd;
+
     public event Action OnSelectCtgIdIndexChangeEvent;
 
     public bool isLogShow = true;
@@ -50,7 +52,8 @@
 
         var config = FuncConfigConfig.Get("TimingGift");
         limitPopCnt = int.Parse(config.Numerical1);
-        limitPopCd = int.Parse(config.Numerical2);
+        limitShowCnt = int.Parse(config.Numerical2);
+        limitPopCd = int.Parse(config.Numerical3);
     }
 
     public override void Release()
@@ -172,7 +175,7 @@
     }
 
     HashSet<int> typeHashSet;
-    int GetPopCnt()
+    int GetShowCnt()
     {
         if (typeHashSet == null)
             typeHashSet = new HashSet<int>();
@@ -189,6 +192,24 @@
             typeHashSet.Add(config.GiftType);
         }
         return typeHashSet.Count;
+    }
+
+    int GetPopCnt()
+    {
+        if (lastTriggerTimeDict.IsNullOrEmpty())
+            return 0;
+        int cnt = 0;
+        foreach (var item in lastTriggerTimeDict)
+        {
+            int type = item.Key;
+            int time = item.Value;
+            var timeData = TimeUtility.GetTime((uint)time);
+            if (timeData.Day == TimeUtility.ServerNow.Day)
+            {
+                cnt += 1;
+            }
+        }
+        return cnt;
     }
 
     bool IsInLimitCd()
@@ -234,14 +255,26 @@
 #endif
             return;
         }
+        int showCnt = GetShowCnt();
 
-        int popCount = GetPopCnt();
-        if (limitPopCnt <= popCount)
+        if (limitShowCnt <= showCnt)
         {
 #if UNITY_EDITOR
             if (isLogShow)
             {
-                Debug.Log($"[TimingGift] TryPop:瑙﹀彂Return,浠婃棩宸茶揪鍒伴檺鍒舵鏁�");
+                Debug.Log($"[TimingGift] TryPop:瑙﹀彂Return,褰撳墠宸茶揪鍒板悓鏃跺睍绀虹殑绀煎寘绫诲瀷鏁伴噺鎬讳笂闄�");
+            }
+#endif
+            return;
+        }
+        int popCnt = GetPopCnt();
+
+        if (limitPopCnt <= popCnt)
+        {
+#if UNITY_EDITOR
+            if (isLogShow)
+            {
+                Debug.Log($"[TimingGift] TryPop:瑙﹀彂Return,浠婃棩宸茶揪鍒扮ぜ鍖呯被鍨嬭Е鍙戞暟閲忔�讳笂闄�");
             }
 #endif
             return;
@@ -270,10 +303,6 @@
 #endif
             return;
         }
-
-
-
-
 
         bool isChange = false;
         for (int i = 0; i < giftIdList.Count; i++)

--
Gitblit v1.8.0