Beispiel #1
0
        public void Buy(ShopItemData item)
        {
            Debug.Log("Selected Quantity" + item.quantity);
            Debug.Log("Selected " + item.id);

            foreach (Product p in QuartersIAP.Instance.products)
            {
                if (p.definition.storeSpecificId == item.id)
                {
                    Debug.Log("Buying... " + p.metadata.localizedTitle);

                    // Buy iAP product
                    QuartersIAP.Instance.BuyProduct(p, (Product product, string txId) => {
                        Debug.Log("Purchase complete");
                        Debug.Log("Quantity: " + item.quantity);

                        //elos.slot.gameInfo.AddBalance(item.quantity);
                        waitModal.Activate();
                        this.Deactivate();
                    }, (string error) => {
                        Debug.LogError("Purchase error: " + error);
                    });
                    break;
                }
            }

            //test
            //LoadingView.instance.Show();
        }