///<summary> /// 打开购买窗口 /// </summary> private void openBuyWindow(Vip vip) { UiManager.Instance.openDialogWindow <BuyWindow> ((win) => { win.init(new LaddersChallengePrice(), Mathf.Min(LaddersManagement.Instance.currentChallengeTimes, vip.privilege.laddersCountBuyAdd - LaddersManagement.Instance.buyFightCount), 1, PrizeType.PRIZE_RMB, (msg) => { if (msg.msgEvent == msg_event.dialogOK) { LaddersChallengePrice price = msg.msgInfo as LaddersChallengePrice; if (price.getPrice(msg.msgNum) > UserManager.Instance.self.getRMB()) { MessageWindow.ShowRecharge(LanguageConfigManager.Instance.getLanguage("s0158")); } else { FPortManager.Instance.getFPort <LaddersBuyChallengeFport> ().access(msg.msgNum, (success) => { if (success) { LaddersManagement.Instance.currentChallengeTimes -= msg.msgNum; LaddersManagement.Instance.buyFightCount += msg.msgNum; M_updateUserInfo(); UiManager.Instance.openDialogWindow <MessageLineWindow> ((showWin) => { showWin.Initialize(LanguageConfigManager.Instance.getLanguage("s0056", LanguageConfigManager.Instance.getLanguage("Arena01"), msg.msgNum.ToString())); }); } }); } } }); }); }
/// <summary> /// justShowNum 是否显示消耗为:几个物品,而不是对应物品的价格 /// </summary> public void calculateTotal() { if (msg.msgInfo.GetType() == typeof(Goods) || item.GetType() == typeof(NoticeActiveGoods)) { Goods good = msg.msgInfo as Goods; totalMoney.text = (now * good.getCostPrice()).ToString(); } //这里添加多样性 else if (msg.msgInfo.GetType() == typeof(Prop)) { //使用道具不显示cost } else if (msg.msgInfo.GetType() == typeof(ArenaChallengePrice)) { ArenaChallengePrice are = msg.msgInfo as ArenaChallengePrice; totalMoney.text = are.getPrice(now).ToString(); } else if (msg.msgInfo.GetType() == typeof(BuyStruct)) { BuyStruct buyStruct = msg.msgInfo as BuyStruct; totalMoney.text = (buyStruct.unitPrice * now).ToString(); } else if (msg.msgInfo.GetType() == typeof(LaddersChallengePrice)) { LaddersChallengePrice are = msg.msgInfo as LaddersChallengePrice; totalMoney.text = are.getPrice(now).ToString(); } }
/// <summary> /// justShowNum 是否显示消耗为:几个物品,而不是对应物品的价格 /// </summary> public void calculateTotal() { if (msg.msgInfo.GetType() == typeof(Goods) || item.GetType() == typeof(NoticeActiveGoods)) { Goods good = msg.msgInfo as Goods; //if (good.getGoodsShopType() == ShopType.LADDER_HEGOMONEY) //{ // totalMoney.text = (now * (good.getCostPrice ()/good.getGoodsShowNum())).ToString (); //} else { // //totalMoney.text = (now * good.getCostPrice ()).ToString (); // totalMoney.text = getTotalCost(good, now); //} totalMoney.text = getTotalCost(good, now, good.getGoodsShopType()); } //这里添加多样性 else if (msg.msgInfo.GetType() == typeof(Prop)) { //使用道具不显示cost } else if (msg.msgInfo.GetType() == typeof(ArenaChallengePrice)) { ArenaChallengePrice are = msg.msgInfo as ArenaChallengePrice; totalMoney.text = are.getPrice(now).ToString(); } else if (msg.msgInfo.GetType() == typeof(BuyStruct)) { BuyStruct buyStruct = msg.msgInfo as BuyStruct; totalMoney.text = (buyStruct.unitPrice * now).ToString(); } else if (msg.msgInfo.GetType() == typeof(BossAttackTimeBuyStruct)) { BossAttackTimeBuyStruct buyStruct = msg.msgInfo as BossAttackTimeBuyStruct; totalMoney.text = (buyStruct.unitPrice * now).ToString(); } else if (msg.msgInfo.GetType() == typeof(LaddersChallengePrice)) { LaddersChallengePrice are = msg.msgInfo as LaddersChallengePrice; totalMoney.text = are.getPrice(now).ToString(); } else if (msg.msgInfo.GetType() == typeof(ActivityChapter)) { ActivityChapter _chapter = msg.msgInfo as ActivityChapter; int[] prises = GoodsBuyCountManager.Instance.getSampleByGoodsSid(_chapter.sid).prise; int rmb = prises.Length <= _chapter.getReBuyNum() ? prises[prises.Length - 1] : prises[_chapter.getReBuyNum()]; totalMoney.text = ((now * (rmb + (rmb + (now - 1) * (prises[1] - prises[0]))))) / 2 + ""; msg.costNum = StringKit.toInt(totalMoney.text); msg.msgNum = now; } }