| | |
| | | return heroConfig.SkinIDList[0]; |
| | | } |
| | | |
| | | public bool IsNoSellOutCTGID(int ctgID) |
| | | public bool IsCanBuy(int ctgID, out bool isNoLimitBuy, out int nowBuyCnt, out int maxBuyCnt) |
| | | { |
| | | isNoLimitBuy = false; |
| | | nowBuyCnt = 0; |
| | | maxBuyCnt = 0; |
| | | CTGConfig config = CTGConfig.Get(ctgID); |
| | | if (config == null) return false; |
| | | if (!RechargeManager.Instance.TryGetRechargeCount(ctgID, out var rechargeCount)) return false; |
| | | if (config == null) |
| | | return false; |
| | | if (!RechargeManager.Instance.TryGetRechargeCount(ctgID, out var rechargeCount)) |
| | | return false; |
| | | |
| | | // 所有限制都为0时,无限购买 |
| | | if (config.TotalBuyCount == 0 && config.DailyBuyCount == 0 && |
| | | config.WeekBuyCount == 0 && config.MonthBuyCount == 0) |
| | | { |
| | | isNoLimitBuy = true; |
| | | return true; |
| | | } |
| | | |
| | | // 按优先级检查:每日 > 每周 > 每月 > 总计 |
| | | if (config.DailyBuyCount > 0) |
| | | { |
| | | nowBuyCnt = rechargeCount.todayCount; |
| | | maxBuyCnt = config.DailyBuyCount; |
| | | return rechargeCount.todayCount < config.DailyBuyCount; |
| | | } |
| | | if (config.WeekBuyCount > 0) |
| | | { |
| | | nowBuyCnt = rechargeCount.weekPayCount; |
| | | maxBuyCnt = config.WeekBuyCount; |
| | | return rechargeCount.weekPayCount < config.WeekBuyCount; |
| | | } |
| | | if (config.MonthBuyCount > 0) |
| | | { |
| | | nowBuyCnt = rechargeCount.monthPayCount; |
| | | maxBuyCnt = config.MonthBuyCount; |
| | | return rechargeCount.monthPayCount < config.MonthBuyCount; |
| | | } |
| | | if (config.TotalBuyCount > 0) |
| | | { |
| | | nowBuyCnt = rechargeCount.totalCount; |
| | | maxBuyCnt = config.TotalBuyCount; |
| | | return rechargeCount.totalCount < config.TotalBuyCount; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public event Action OnCurrentChooseSkinIDChangeEevent; |
| | | private int m_currentChooseSkinID = 0; |