| | |
| | | public int[] selectCtgIds; |
| | | public int[][] selectGainItemList; |
| | | public int limitPopCnt; |
| | | public int limitShowCnt; |
| | | public int limitPopCd; |
| | | |
| | | public event Action OnSelectCtgIdIndexChangeEvent; |
| | | |
| | | public bool isLogShow = true; |
| | |
| | | |
| | | 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() |
| | |
| | | } |
| | | |
| | | HashSet<int> typeHashSet; |
| | | int GetPopCnt() |
| | | int GetShowCnt() |
| | | { |
| | | if (typeHashSet == null) |
| | | typeHashSet = new HashSet<int>(); |
| | |
| | | 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() |
| | |
| | | #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; |
| | |
| | | #endif |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | bool isChange = false; |
| | | for (int i = 0; i < giftIdList.Count; i++) |