Exemplo n.º 1
0
    void buy(GameObject obj)
    {
        int maxBuyNum = GoodsBuyCountManager.Instance.getSampleByGoodsSid(chapter.sid).vipMaxCount[UserManager.Instance.self.getVipLevel()];

        if (chapter.getReBuyNum() >= maxBuyNum)
        {
            UiManager.Instance.openDialogWindow <MessageWindow>((win) =>
            {
                win.initWindow(2, LanguageConfigManager.Instance.getLanguage("recharge01"), LanguageConfigManager.Instance.getLanguage("s0093"),
                               LanguageConfigManager.Instance.getLanguage("s015316"), (msgHandle) =>
                {
                    if (msgHandle.buttonID == MessageHandle.BUTTON_LEFT)
                    {
                        UiManager.Instance.openWindow <VipWindow>();
                    }
                });
            });
        }
        else
        {
            UiManager.Instance.openDialogWindow <BuyWindow>((win) => {
                win.init(chapter, Mathf.Min((maxBuyNum - chapter.Buyed), timesCanbuyWithRMB()), 1, PrizeType.PRIZE_RMB, (msg) => { msgBack(msg); });
            });
        }
    }
Exemplo n.º 2
0
    public override void DoClickEvent()
    {
        base.DoClickEvent();
        if (UserManager.Instance.self.getUserLevel() < mission.getRequirLevel())
        {
            MaskWindow.UnlockUI();
            return;
        }
        if ((FuBenManagerment.Instance.getActivityChapterBySid(mission.getChapterSid())).getNum() == 0)
        {
            int maxBuyNum = GoodsBuyCountManager.Instance.getSampleByGoodsSid(chapter.sid).vipMaxCount[UserManager.Instance.self.getVipLevel()];
            if (chapter.getReBuyNum() >= maxBuyNum)
            {
                UiManager.Instance.openDialogWindow <MessageWindow>((win) => {
                    win.initWindow(2, LanguageConfigManager.Instance.getLanguage("recharge01"), LanguageConfigManager.Instance.getLanguage("s0093"),
                                   LanguageConfigManager.Instance.getLanguage("s015316"), (mesgHandle) => {
                        if (mesgHandle.buttonID == MessageHandle.BUTTON_LEFT)
                        {
                            UiManager.Instance.openWindow <VipWindow>();
                        }
                    });
                });
            }
            else
            {
                UiManager.Instance.openDialogWindow <BuyWindow>((win) => {
                    win.init(chapter, Mathf.Min((maxBuyNum - chapter.Buyed), timesCanbuyWithRMB()), 1, PrizeType.PRIZE_RMB, (msg) => { msgBack(msg); });
                });
            }
        }
        //不在检查体力
        //if ((UserManager.Instance.self.getPvEPoint ()+UserManager.Instance.self.getStorePvEPoint()) < mission.allCostPve) {
        //    UiManager.Instance.openDialogWindow<MessageWindow>((win)=>{
        //        win.initWindow (2, LanguageConfigManager.Instance.getLanguage ("s0094"), LanguageConfigManager.Instance.getLanguage ("s0093"), LanguageConfigManager.Instance.getLanguage ("s0163", mission.allCostPve.ToString ()), intoFubenBack);
        //    });
        //    return;
        //}
//		UiManager.Instance.openWindow<TeamPrepareWindow>((win) => {
//			win.Initialize (mission,TeamPrepareWindow.WIN_ACTIVITY_ITEM_TYPE);
//		});
//		int teamId = ArmyManager.PVE_TEAMID;
//		MissionSample sample = MissionSampleManager.Instance.getMissionSampleBySid (mission.sid);
//		int cSid = sample.chapterSid;
//		int type = ChapterSampleManager.Instance.getChapterSampleBySid (cSid).type;
        //if (UserManager.Instance.self.getPvEPoint () < 1) {
        //    UiManager.Instance.openDialogWindow<PveUseWindow> ();
        //    return;
        //}
        if ((FuBenManagerment.Instance.getActivityChapterBySid(mission.getChapterSid())).getNum() > 0)
        {
            MessageHandle msgHandle = new MessageHandle();
            msgHandle.buttonID = MessageHandle.BUTTON_RIGHT;
            intoFubenBack(msgHandle);
        }
    }
Exemplo n.º 3
0
 /// <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;
     }
 }