Exemplo n.º 1
0
    public void ComprarUpgrade(Upgrade p)
    {
        Mejora item = new Mejora();


        item = p.storeItem;
        if (SM.CanPurcheaseItem(item))
        {
            SM.BuyItem(item);

            bc.goldCounterA = SM.billetera.dineroJugador[0];
            bc.goldCounterB = SM.billetera.dineroJugador[1];
            p.Click();
        }
    }
Exemplo n.º 2
0
        public void Purchase(CocoStoreID id, Action <BuyItemResult> doneAction = null)
        {
            var itemData = StoreConfigData.GetItemData(id);

            if (itemData == null)
            {
                if (doneAction != null)
                {
                    doneAction(new BuyItemResult(BuyItemResultCode.Error));
                }
                return;
            }

            if (!IsBillingAvailable)
            {
                if (doneAction != null)
                {
                    doneAction(new BuyItemResult(BuyItemResultCode.Error));
                }
//				CocoMainController.ShowNoInternetPopup ();
                return;
            }

            StoreManager.BuyItem(itemData.Key).Done(result => OnPurchaseDone(itemData, result, doneAction));
        }
Exemplo n.º 3
0
 public void PointerDown()
 {
     if (!StoreManager.ItemsSold[(int)item])
     {
         if (CoinController.AmountOfCoins >= price)
         {
             storeManager.BuyItem(item, price);
             GetComponentInChildren <Text>().text = item.ToString() + " SOLD";
         }
         else
         {
             GetComponentInChildren <Text>().text = "NO COINS!";
         }
     }
 }