| | |
| | | maxCnt = shopConfig.LimitCnt - buyCnt; |
| | | if (maxCnt == 0) |
| | | { |
| | | //没有限购,用货币可购买数量 |
| | | maxCnt = Math.Max(1, (int)(UIHelper.GetMoneyCnt(shopConfig.MoneyType)/shopConfig.MoneyNum)); |
| | | if (shopConfig.MoneyType <= 0) |
| | | { |
| | | maxCnt = Math.Max(1, (int)(PackManager.Instance.GetItemCountByID(PackType.Item, shopConfig.CostItemID) / shopConfig.MoneyNum)); |
| | | } |
| | | else |
| | | { |
| | | //没有限购,用货币可购买数量 |
| | | maxCnt = Math.Max(1, (int)(UIHelper.GetMoneyCnt(shopConfig.MoneyType) / shopConfig.MoneyNum)); |
| | | } |
| | | } |
| | | |
| | | OnSliderChange(useCnt); |
| | |
| | | } |
| | | limitText.text = limitStr; |
| | | |
| | | moneyIcon.SetIconWithMoneyType(shopConfig.MoneyType); |
| | | moneyText.text = UIHelper.ShowUseMoney(shopConfig.MoneyType, shopConfig.MoneyNum * useCnt, false); |
| | | if (shopConfig.MoneyType <= 0) |
| | | { |
| | | moneyIcon.SetItemSprite(shopConfig.CostItemID); |
| | | moneyText.text = UIHelper.ShowUseItem(PackType.Item, shopConfig.CostItemID, shopConfig.MoneyNum * useCnt, false); |
| | | } |
| | | else |
| | | { |
| | | moneyIcon.SetIconWithMoneyType(shopConfig.MoneyType); |
| | | moneyText.text = UIHelper.ShowUseMoney(shopConfig.MoneyType, shopConfig.MoneyNum * useCnt, false); |
| | | } |
| | | |
| | | |
| | | } |
| | | |