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; } }
public static void addToCurrency(int amt) { shopConents.addCurrency(amt); if (GameObject.Find("wallet") != null) { ShopScreen.displayWallet(ShopControl.shopConents.getCurrency()); } }
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); }