Пример #1
0
    public void OnClick()
    {
        if (UserMgr.UserInfo.gold < transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>().mFee)
        {
            UtilMgr.NotEnoughGold();
            return;
        }

        if (name.Equals("BtnPowerUp"))
        {
            mLevelBefore = transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>().mTargetCard.cardLevel;
            mCardUpEvent = new CardUpEvent(ReceivedLevelUp);
            NetMgr.CardLevelUp(
                transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>().mTargetCard,
                transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>().mCardFeedList, mCardUpEvent);
        }
        else
        {
            mClassBefore = transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>().mTargetCard.cardClass;
            mCardUpEvent = new CardUpEvent(ReceivedRankUp);
            NetMgr.CardRankUp(
                transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>().mTargetCard,
                transform.root.FindChild("CardPowerUp").GetComponent <CardPowerUp>().mCardFeedList[0], mCardUpEvent);
        }
    }
Пример #2
0
    public void OnClick()
    {
        if (transform.root.FindChild("Shop").GetComponent <Shop>().mCategory == Shop.GOLD)
        {
            transform.root.FindChild("Shop").GetComponent <Shop>().RequestIAP(mGoldInfo.productCode,
                                                                              mGoldInfo.productName);
        }
        else
        {
            if (UserMgr.UserInfo.gold < mItemInfo.price)
            {
                UtilMgr.NotEnoughGold();
                return;
            }

            mGoldEvent = new PurchaseGoldEvent(ReceivedPurchase);
            NetMgr.PurchaseGold(mItemInfo.productCode, mGoldEvent);
        }
    }