| | |
| | | model.PlayAnimationSync += OnPlaySyncAnimation;
|
| | | if (curValue == 0)
|
| | | return;
|
| | | OperationRechargeGiftAct act; |
| | | OperationTimeHepler.Instance.TryGetOperation(FairyAffinityRechargeGiftActModel.operaType, out act); |
| | | if (act == null) return;
|
| | | int awardShowIndex = GetAwardShowIndex();
|
| | | var awardInfo = act.buyCountGifts[awardShowIndex];
|
| | | int freeState = model.GetBuyGiftState(0);
|
| | | int cntState = model.GetBuyGiftState(model.getGiftCount);
|
| | | int cntState = model.GetBuyGiftState(awardInfo.NeedBuyCount);
|
| | |
|
| | | for (int i = 0; i < freeTweenList.Count; i++)
|
| | | {
|
| | |
| | | buyCountGiftTweenList[i].Stop();
|
| | | buyCountGiftTweenList[i].SetStartState();
|
| | | }
|
| | | OperationRechargeGiftAct act; |
| | | OperationTimeHepler.Instance.TryGetOperation(FairyAffinityRechargeGiftActModel.operaType, out act); |
| | | if (act == null) return;
|
| | | int awardShowIndex = GetAwardShowIndex();
|
| | | var awardInfo = act.buyCountGifts[awardShowIndex];
|
| | | int freeState = model.GetBuyGiftState(0);
|
| | | int cntState = model.GetBuyGiftState(model.getGiftCount);
|
| | | int cntState = model.GetBuyGiftState(awardInfo.NeedBuyCount);
|
| | |
|
| | | for (int i = 0; i < freeTweenList.Count; i++)
|
| | | {
|
| | |
| | | {
|
| | | OperationRechargeGiftAct act; |
| | | OperationTimeHepler.Instance.TryGetOperation(FairyAffinityRechargeGiftActModel.operaType, out act);
|
| | | int freeState = model.GetBuyGiftState(0);
|
| | | int cntState = model.GetBuyGiftState(model.getGiftCount); |
| | |
|
| | | var awardInfo = act.buyCountGifts[0];
|
| | | var awards = awardInfo.AwardItemList;
|
| | | int freeState = model.GetBuyGiftState(0);
|
| | | |
| | |
|
| | | for (int i = 0; i < freeItems.Count; i++) |
| | | { |
| | |
| | | } |
| | | }
|
| | |
|
| | | awardInfo = act.buyCountGifts[GetIndex(model.getGiftCount)];
|
| | | int awardShowIndex = GetAwardShowIndex();
|
| | | awardInfo = act.buyCountGifts[awardShowIndex];
|
| | | int cntState = model.GetBuyGiftState(awardInfo.NeedBuyCount);
|
| | | awards = awardInfo.AwardItemList; |
| | | for (int i = 0; i < buyCountGiftItems.Count; i++) |
| | | { |
| | |
| | | { |
| | | if (cntState == 1)
|
| | | {
|
| | | model.SendGetAward(model.getGiftCount);
|
| | | model.SendGetAward(awardInfo.NeedBuyCount);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | } |
| | | }
|
| | |
|
| | | int totalBuyCnt = model.GetBuyTotalCnt(); |
| | | buyCountGiftSlider.value = totalBuyCnt / (float)model.getGiftCount; |
| | | buyCountGiftSliderText.text = string.Format("{0}/{1}", totalBuyCnt, model.getGiftCount); |
| | | buyCountGiftText.text = Language.Get("FairyAffinity11", Mathf.Max(0, model.getGiftCount - totalBuyCnt));
|
| | | int totalBuyCnt = model.GetBuyTotalCnt();
|
| | | int needBuyCount = awardInfo.NeedBuyCount; |
| | | buyCountGiftSlider.value = totalBuyCnt / (float)needBuyCount; |
| | | buyCountGiftSliderText.text = string.Format("{0}/{1}", totalBuyCnt,needBuyCount); |
| | | buyCountGiftText.text = Language.Get("FairyAffinity11", Mathf.Max(0, needBuyCount));
|
| | |
|
| | | model.IsPlayAnimation = true; |
| | | } |
| | | |
| | | |
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | |
| | | return seconds;
|
| | | } |
| | | |
| | | private int GetIndex(int cnt)
|
| | | {
|
| | | OperationRechargeGiftAct act; |
| | | OperationTimeHepler.Instance.TryGetOperation(FairyAffinityRechargeGiftActModel.operaType, out act); |
| | | if (act == null) return 0;
|
| | | for (int i = 0; i < act.buyCountGifts.Count; i++) |
| | | {
|
| | | if (act.buyCountGifts[i].NeedBuyCount == cnt)
|
| | | {
|
| | | return i;
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | } |
| | | |
| | | private int GetAwardShowIndex()
|
| | | {
|
| | | OperationRechargeGiftAct act; |
| | | OperationTimeHepler.Instance.TryGetOperation(FairyAffinityRechargeGiftActModel.operaType, out act); |
| | | if (act == null) return 0; |
| | | |
| | | for (int i = 0; i < act.buyCountGifts.Count; i++) |
| | | for (int i = 1; i < act.buyCountGifts.Count; i++) |
| | | { |
| | | if (model.GetBuyGiftState(act.buyCountGifts[i].NeedBuyCount) != 2) |
| | | { |
| | |
| | | buyCountGiftTweenList[i].Stop();
|
| | | buyCountGiftTweenList[i].SetStartState();
|
| | | }
|
| | | OperationRechargeGiftAct act; |
| | | OperationTimeHepler.Instance.TryGetOperation(FairyAffinityRechargeGiftActModel.operaType, out act); |
| | | if (act == null) return ;
|
| | | int awardShowIndex = GetAwardShowIndex();
|
| | | var awardInfo = act.buyCountGifts[awardShowIndex];
|
| | | int freeState = model.GetBuyGiftState(0);
|
| | | int cntState = model.GetBuyGiftState(model.getGiftCount);
|
| | | int cntState = model.GetBuyGiftState(awardInfo.NeedBuyCount);
|
| | |
|
| | | for (int i = 0; i < freeTweenList.Count; i++)
|
| | | {
|