Пример #1
0
    public void purchaseItem()
    {
        string itemInfo = ShopScreen.selectedItem;

        Debug.Log(itemInfo);
        if (itemInfo == null)
        {
            return;
        }
        Item item = itemHolder.itemConverter(itemInfo);

        if (checkPurchase(item))
        {
            //Update usercurrency
            shopConents.changeCurrency(item);
            ShopScreen.displayWallet(shopConents.getCurrency());
            Debug.Log("Success");
            ItemControl.transferToInventory(item);
        }
        else
        {
            ShopScreen.displayInsufficentFunds();
            return;
        }
    }
Пример #2
0
 public static void addToCurrency(int amt)
 {
     shopConents.addCurrency(amt);
     if (GameObject.Find("wallet") != null)
     {
         ShopScreen.displayWallet(ShopControl.shopConents.getCurrency());
     }
 }
Пример #3
0
    public void Start()
    {
        toggleShop.onClick.AddListener(delegate
        {
            //this.gameObject.SetActive(false);
            this.gameObject.SetActive(!this.gameObject.activeSelf);
            if (this.gameObject.activeSelf)
            {
                ShopScreen.displayWallet(ShopControl.shopConents.getCurrency());
            }
        });

        displayWallet(ShopControl.getCurrency());

        this.gameObject.SetActive(false);
    }