Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | if (!DayRemind.Instance.GetDayRemind(DayRemind.FAIRYGRABBOSS_NOTICE_REDPOINT)
|
| | | && IsOpen)
|
| | | {
|
| | | //fairyGrabBossNoticeRedpoint.state = RedPointState.Simple;
|
| | | fairyGrabBossNoticeRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | using Snxxz.UI; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using TableConfig; |
| | | |
| | | public class BuyItemPopModel : Singleton<BuyItemPopModel> |
| | | { |
| | | public StoreConfig storeConfig { get; private set; } |
| | | |
| | | public void SetModel(int shopId) |
| | | { |
| | | storeConfig = Config.Instance.Get<StoreConfig>(shopId); |
| | | } |
| | | |
| | | public Dictionary<int, int> vipBuyCntDict = new Dictionary<int, int>(); |
| | | public bool CheckIsVipBuy(StoreConfig model,out int curVipIndex,out int nextVipIndex) |
| | | { |
| | | vipBuyCntDict.Clear(); |
| | | curVipIndex = -1; |
| | | nextVipIndex = -1; |
| | | bool isVipBuy = false; |
| | | if (model == null) return isVipBuy; |
| | | |
| | | if (model.VIPLV.Length < 2) |
| | | { |
| | | if (model.VIPLV[0] != 0) |
| | | { |
| | | isVipBuy = true; |
| | | } |
| | | else |
| | | { |
| | | isVipBuy = false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | isVipBuy = true; |
| | | } |
| | | |
| | | if(isVipBuy) |
| | | { |
| | | for (int i = model.VIPLV.Length-1; i > -1; i--) |
| | | { |
| | | vipBuyCntDict.Add(model.VIPLV[i], model.PurchaseNumber[i]); |
| | | } |
| | | int playerVip = PlayerDatas.Instance.baseData.VIPLv; |
| | | for (int i = model.VIPLV.Length - 1; i > -1; i--) |
| | | { |
| | | if (model.VIPLV[i] > playerVip) |
| | | { |
| | | nextVipIndex = i; |
| | | } |
| | | else if(model.VIPLV[i] <= playerVip) |
| | | { |
| | | curVipIndex = i; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | return isVipBuy; |
| | | } |
| | | |
| | | public bool CheckIsLimitBuyCnt(StoreConfig model,out int canBuyCnt,out int addBuyCnt) |
| | | { |
| | | canBuyCnt = 0; |
| | | addBuyCnt = 0; |
| | | if (model == null) return false; |
| | | |
| | | int[] canBuyNums = model.PurchaseNumber; |
| | | int curVipIndex = -1; |
| | | int nexVipIndex = -1; |
| | | bool isVipBuy = CheckIsVipBuy(model, out curVipIndex, out nexVipIndex); |
| | | if (isVipBuy) |
| | | { |
| | | if (curVipIndex != -1) |
| | | { |
| | | canBuyCnt = canBuyNums[curVipIndex]; |
| | | } |
| | | |
| | | if (nexVipIndex != -1) |
| | | { |
| | | addBuyCnt = canBuyNums[nexVipIndex] - canBuyCnt; |
| | | } |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | if (canBuyNums[0] != 0) |
| | | { |
| | | canBuyCnt = canBuyNums[0]; |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public int GetCurBuyCnt(int buyCnt,int canBuyCnt,bool isVipBuy,out bool IsReachUpper) |
| | | { |
| | | int count = 0; |
| | | IsReachUpper = false; |
| | | if(canBuyCnt == 0) |
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using System.Text;
|
| | | using TableConfig;
|
| | |
|
| | | public class BuyItemPopModel : Singleton<BuyItemPopModel>
|
| | | {
|
| | | public StoreConfig storeConfig { get; private set; }
|
| | |
|
| | | public void SetModel(int shopId)
|
| | | {
|
| | | storeConfig = Config.Instance.Get<StoreConfig>(shopId);
|
| | | }
|
| | |
|
| | | public Dictionary<int, int> vipBuyCntDict = new Dictionary<int, int>();
|
| | | public bool CheckIsVipBuy(StoreConfig model,out int curVipIndex,out int nextVipIndex)
|
| | | {
|
| | | vipBuyCntDict.Clear();
|
| | | curVipIndex = -1;
|
| | | nextVipIndex = -1;
|
| | | bool isVipBuy = false;
|
| | | if (model == null) return isVipBuy;
|
| | |
|
| | | if (model.VIPLV.Length < 2)
|
| | | {
|
| | | IsReachUpper = true; |
| | | count = 0; |
| | | } |
| | | else |
| | | { |
| | | if(buyCnt <= canBuyCnt) |
| | | { |
| | | count = buyCnt; |
| | | } |
| | | else |
| | | { |
| | | count = canBuyCnt; |
| | | IsReachUpper = true; |
| | | } |
| | | } |
| | | |
| | | if(count < 0) |
| | | { |
| | | count = 0; |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | public int GetBuyPrice(StoreConfig model,int buyCnt) |
| | | { |
| | | if (model == null) return 0; |
| | | |
| | | int buyItemPrice = model.MoneyNumber * buyCnt; |
| | | return buyItemPrice; |
| | | } |
| | | } |
| | | if (model.VIPLV[0] != 0)
|
| | | {
|
| | | isVipBuy = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | isVipBuy = false;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | isVipBuy = true;
|
| | | }
|
| | |
|
| | | if(isVipBuy)
|
| | | {
|
| | | for (int i = model.VIPLV.Length-1; i > -1; i--)
|
| | | {
|
| | | vipBuyCntDict.Add(model.VIPLV[i], model.PurchaseNumber[i]);
|
| | | }
|
| | | int playerVip = PlayerDatas.Instance.baseData.VIPLv;
|
| | | for (int i = model.VIPLV.Length - 1; i > -1; i--)
|
| | | {
|
| | | if (model.VIPLV[i] > playerVip)
|
| | | {
|
| | | nextVipIndex = i;
|
| | | }
|
| | | else if(model.VIPLV[i] <= playerVip)
|
| | | {
|
| | | curVipIndex = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | return isVipBuy;
|
| | | }
|
| | |
|
| | | public bool CheckIsLimitBuyCnt(StoreConfig model,out int canBuyCnt,out int addBuyCnt)
|
| | | {
|
| | | canBuyCnt = 0;
|
| | | addBuyCnt = 0;
|
| | | if (model == null) return false;
|
| | |
|
| | | int[] canBuyNums = model.PurchaseNumber;
|
| | | int curVipIndex = -1;
|
| | | int nexVipIndex = -1;
|
| | | bool isVipBuy = CheckIsVipBuy(model, out curVipIndex, out nexVipIndex);
|
| | | if (isVipBuy)
|
| | | {
|
| | | if (curVipIndex != -1)
|
| | | {
|
| | | canBuyCnt = canBuyNums[curVipIndex];
|
| | | }
|
| | |
|
| | | if (nexVipIndex != -1)
|
| | | {
|
| | | addBuyCnt = canBuyNums[nexVipIndex] - canBuyCnt;
|
| | | }
|
| | | return true;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (canBuyNums[0] != 0)
|
| | | {
|
| | | canBuyCnt = canBuyNums[0];
|
| | | return true;
|
| | | }
|
| | | else
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public int GetCurBuyCnt(int buyCnt,int remainBuyCnt,out bool IsReachUpper)
|
| | | {
|
| | | int count = 0;
|
| | | IsReachUpper = false;
|
| | | if(remainBuyCnt == 0)
|
| | | {
|
| | | IsReachUpper = true;
|
| | | count = 0;
|
| | | }
|
| | | else
|
| | | {
|
| | | if(buyCnt <= remainBuyCnt)
|
| | | {
|
| | | count = buyCnt;
|
| | | }
|
| | | else
|
| | | {
|
| | | count = remainBuyCnt;
|
| | | IsReachUpper = true;
|
| | | }
|
| | | }
|
| | |
|
| | | if(count < 0)
|
| | | {
|
| | | count = 0;
|
| | | }
|
| | | return count;
|
| | | }
|
| | |
|
| | | public int GetRemainBuyCnt(int canBuyCnt,BuyShopItemLimit shopItemLimit,bool isVipBuy)
|
| | | {
|
| | | int haveBuyCnt = 0;
|
| | | if (shopItemLimit != null)
|
| | | {
|
| | | haveBuyCnt = shopItemLimit.BuyCnt;
|
| | | }
|
| | |
|
| | | if (canBuyCnt <= 0 && !isVipBuy)
|
| | | {
|
| | | canBuyCnt = 9999;
|
| | | }
|
| | | int remainCnt = canBuyCnt - haveBuyCnt;
|
| | | if (remainCnt >= 0)
|
| | | {
|
| | | return remainCnt;
|
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | }
|
| | | public int GetBuyPrice(StoreConfig model,int buyCnt)
|
| | | {
|
| | | if (model == null) return 0;
|
| | |
|
| | | int buyItemPrice = model.MoneyNumber * buyCnt;
|
| | | return buyItemPrice;
|
| | | }
|
| | | }
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig,out canBuyCnt,out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemTipsModel.curAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | if(isVipBuy)
|
| | | {
|
| | | if(nextVipIndex != -1)
|
| | |
| | | else
|
| | | {
|
| | | buyBtn.gameObject.SetActive(false);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, out isReachUpper);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | |
|
| | | if (_price <= 0)
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | moneyRect.gameObject.SetActive(false);
|
| | | buyBtnText.text = Language.Get("MailReceive");
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | moneyRect.gameObject.SetActive(true);
|
| | | buyBtnText.text = Language.Get("ItemHandle_buy");
|
| | | }
|
| | |
|
| | | if (_price <= 0 || itemTipsModel.curAttrData.itemConfig.PackCount < 2)
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | |
| | | }
|
| | | }
|
| | | #region 点击事件
|
| | |
| | | numKeyboard.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | private int GetRemainBuyCnt()
|
| | | {
|
| | | int haveBuyCnt = 0;
|
| | | if (shopItemLimit != null)
|
| | | {
|
| | | haveBuyCnt = shopItemLimit.BuyCnt;
|
| | | }
|
| | | int remainCnt = canBuyCnt - haveBuyCnt;
|
| | | if (remainCnt >= 0)
|
| | | {
|
| | | return remainCnt;
|
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnClickNum()
|
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value),GetRemainBuyCnt(), isVipBuy,out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy),out isReachUpper);
|
| | | RefreshBuyPrice(buyCnt);
|
| | | numKeyboard.Value = buyCnt.ToString();
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt += 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt -= 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy,out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy),out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | }
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig, out canBuyCnt, out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | _numberGo.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | _numberGo.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | if (isVipBuy)
|
| | | {
|
| | | if (nextVipIndex != -1)
|
| | |
| | | else
|
| | | {
|
| | | btnGroup.gameObject.SetActive(false);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, out isReachUpper);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | |
|
| | | if (_price <= 0)
|
| | | {
|
| | | _numberGo.gameObject.SetActive(false);
|
| | | moneyRect.gameObject.SetActive(false);
|
| | | buyBtnText.text = Language.Get("MailReceive");
|
| | | }
|
| | | else
|
| | | {
|
| | | _numberGo.gameObject.SetActive(true);
|
| | | moneyRect.gameObject.SetActive(true);
|
| | | buyBtnText.text = Language.Get("ItemHandle_buy");
|
| | | }
|
| | |
|
| | | if (_price <= 0 || itemAttrData.itemConfig.PackCount < 2)
|
| | | {
|
| | | _numberGo.gameObject.SetActive(false);
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | | _numberGo.gameObject.SetActive(true);
|
| | | |
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | numKeyboard.gameObject.SetActive(true);
|
| | | }
|
| | | private int GetRemainBuyCnt()
|
| | | {
|
| | | int haveBuyCnt = 0;
|
| | | if (shopItemLimit != null)
|
| | | {
|
| | | haveBuyCnt = shopItemLimit.BuyCnt;
|
| | | }
|
| | | int remainCnt = canBuyCnt - haveBuyCnt;
|
| | | if (remainCnt >= 0)
|
| | | {
|
| | | return remainCnt;
|
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | }
|
| | | |
| | | private void OnClickNum()
|
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | RefreshBuyPrice(buyCnt);
|
| | | numKeyboard.Value = buyCnt.ToString();
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt += 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | m_storeModel.SetBuyCnt(buyCnt);
|
| | |
| | | {
|
| | | buyCnt -= 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | m_storeModel.SetBuyCnt(buyCnt);
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig, out canBuyCnt, out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | _numberGo.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | _numberGo.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit,isVipBuy), out isReachUpper);
|
| | | if (isVipBuy)
|
| | | {
|
| | | if (nextVipIndex != -1)
|
| | |
| | | else
|
| | | {
|
| | | buyBtn.gameObject.SetActive(false);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, out isReachUpper);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | |
|
| | | if (_price <= 0)
|
| | | {
|
| | | _numberGo.gameObject.SetActive(false);
|
| | | moneyRect.gameObject.SetActive(false);
|
| | | buyBtnText.text = Language.Get("MailReceive");
|
| | | }
|
| | | else
|
| | | {
|
| | | _numberGo.gameObject.SetActive(true);
|
| | | moneyRect.gameObject.SetActive(true);
|
| | | buyBtnText.text = Language.Get("ItemHandle_buy");
|
| | | }
|
| | |
|
| | | if (_price <= 0 || itemAttrData.itemConfig.PackCount < 2)
|
| | | {
|
| | | _numberGo.gameObject.SetActive(false);
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | | _numberGo.gameObject.SetActive(true);
|
| | | |
| | | }
|
| | | }
|
| | | #region 点击事件
|
| | |
| | | numKeyboard.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | private int GetRemainBuyCnt()
|
| | | {
|
| | | int haveBuyCnt = 0;
|
| | | if (shopItemLimit != null)
|
| | | {
|
| | | haveBuyCnt = shopItemLimit.BuyCnt;
|
| | | }
|
| | | int remainCnt = canBuyCnt - haveBuyCnt;
|
| | | if (remainCnt >= 0)
|
| | | {
|
| | | return remainCnt;
|
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnClickNum()
|
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | RefreshBuyPrice(buyCnt);
|
| | | numKeyboard.Value = buyCnt.ToString();
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt += 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt -= 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | |
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig,out canBuyCnt,out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemTipsModel.curAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | buyCnt = buyItem.GetCurBuyCnt(1,buyItem.GetRemainBuyCnt(canBuyCnt,shopItemLimit, isVipBuy), out isReachUpper);
|
| | | |
| | | buyBtn.gameObject.SetActive(true);
|
| | |
|
| | | if (isVipBuy)
|
| | |
| | | else
|
| | | {
|
| | | buyBtn.gameObject.SetActive(false);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, out isReachUpper);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | buyPriceText.text = UIHelper.GetTextColorByItemColor(TextColType.Green, _price.ToString());
|
| | | }
|
| | |
|
| | | if(_price <= 0)
|
| | | if (_price <= 0)
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | moneyRect.gameObject.SetActive(false);
|
| | | buyBtnText.text = Language.Get("MailReceive");
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | moneyRect.gameObject.SetActive(true);
|
| | | buyBtnText.text = Language.Get("ItemHandle_buy");
|
| | | moneyRect.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | if (_price <= 0 || itemTipsModel.curAttrData.itemConfig.PackCount < 2)
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | | #region 点击事件
|
| | | private int GetRemainBuyCnt()
|
| | | {
|
| | | int haveBuyCnt = 0;
|
| | | if(shopItemLimit != null)
|
| | | {
|
| | | haveBuyCnt = shopItemLimit.BuyCnt;
|
| | | }
|
| | | int remainCnt = canBuyCnt - haveBuyCnt;
|
| | | if(remainCnt >= 0)
|
| | | {
|
| | | return remainCnt;
|
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | private void OnClickCountBtn()
|
| | | {
|
| | | numKeyboard.gameObject.SetActive(true);
|
| | |
| | | private void OnClickNum()
|
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value),buyItem.GetRemainBuyCnt(canBuyCnt,shopItemLimit, isVipBuy), out isReachUpper);
|
| | | RefreshBuyPrice(buyCnt);
|
| | | numKeyboard.Value = buyCnt.ToString();
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt += 1;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt,shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | if (isReachUpper || buyCnt == 0)
|
| | |
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt -= 1;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt,buyItem.GetRemainBuyCnt(canBuyCnt,shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | }
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig,out canBuyCnt,out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemTipsModel.curAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyBtn.gameObject.SetActive(true);
|
| | |
|
| | | if (isVipBuy)
|
| | |
| | | else
|
| | | {
|
| | | buyBtn.gameObject.SetActive(false);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, out isReachUpper);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | |
|
| | | if (_price <= 0)
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | moneyRect.gameObject.SetActive(false);
|
| | | buyBtnText.text = Language.Get("MailReceive");
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | moneyRect.gameObject.SetActive(true);
|
| | | buyBtnText.text = Language.Get("ItemHandle_buy");
|
| | | moneyRect.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | | #region 点击事件
|
| | | private int GetRemainBuyCnt()
|
| | | {
|
| | | int haveBuyCnt = 0;
|
| | | if(shopItemLimit != null)
|
| | |
|
| | | if (_price <= 0 || itemTipsModel.curAttrData.itemConfig.PackCount < 2)
|
| | | {
|
| | | haveBuyCnt = shopItemLimit.BuyCnt;
|
| | | }
|
| | | int remainCnt = canBuyCnt - haveBuyCnt;
|
| | | if(remainCnt >= 0)
|
| | | {
|
| | | return remainCnt;
|
| | | numberGo.gameObject.SetActive(false);
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | numberGo.gameObject.SetActive(true);
|
| | | |
| | | }
|
| | | }
|
| | |
|
| | | #region 点击事件
|
| | | |
| | | private void OnClickCountBtn()
|
| | | {
|
| | | numKeyboard.gameObject.SetActive(true);
|
| | |
| | | private void OnClickNum()
|
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value),GetRemainBuyCnt(), isVipBuy,out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy),out isReachUpper);
|
| | | RefreshBuyPrice(buyCnt);
|
| | | numKeyboard.Value = buyCnt.ToString();
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt += 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt,GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt -= 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy,out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy),out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | }
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig, out canBuyCnt, out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | if (isVipBuy)
|
| | | {
|
| | | if (nextVipIndex != -1)
|
| | |
| | | else
|
| | | {
|
| | | buyBtn.gameObject.SetActive(false);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, out isReachUpper);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | {
|
| | | buyPriceText.text = UIHelper.GetTextColorByItemColor(TextColType.Green, _price.ToString());
|
| | | }
|
| | |
|
| | | |
| | | if (_price <= 0)
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | moneyRect.gameObject.SetActive(false);
|
| | | buyBtnText.text = Language.Get("MailReceive");
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | moneyRect.gameObject.SetActive(true);
|
| | | buyBtnText.text = Language.Get("ItemHandle_buy");
|
| | | }
|
| | |
|
| | | if(_price <= 0 || itemAttrData.itemConfig.PackCount < 2)
|
| | | {
|
| | | numberGo.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | | |
| | | }
|
| | | }
|
| | | #region 点击事件
|
| | |
| | | numKeyboard.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | private int GetRemainBuyCnt()
|
| | | {
|
| | | int haveBuyCnt = 0;
|
| | | if (shopItemLimit != null)
|
| | | {
|
| | | haveBuyCnt = shopItemLimit.BuyCnt;
|
| | | }
|
| | | int remainCnt = canBuyCnt - haveBuyCnt;
|
| | | if (remainCnt >= 0)
|
| | | {
|
| | | return remainCnt;
|
| | | }
|
| | | else
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnClickNum()
|
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | RefreshBuyPrice(buyCnt);
|
| | | numKeyboard.Value = buyCnt.ToString();
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt += 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | if (isReachUpper)
|
| | |
| | | {
|
| | | buyCnt -= 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | |
|