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);
        }
    }
示例#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);
        }
    }