public void SetUp(InventoryItem item, Transaction transaction, ShopGui shop) { this.item = item; this.shop = shop; icon.sprite = Resources.Load <Sprite>(item.ID.ToString()); nameText.text = item.ID.ToString(); amountText.text = item.Amount.ToString(); setTransaction(transaction); setTransactionAmount(1); setTransactionCost(); }
public void SetItemInfo(ShopGui owner, Item item, EquipmentManager.ItemCategory itemCategory) { this.NameLabel.text = item.ItemName; this.PriceLabel.text = item.Cost.ToString("N0"); if (itemCategory == EquipmentManager.ItemCategory.Weapon) { this.InfoLabel.text = (item as Weapon).Damage.ToString("N0"); this.InfoIcon.spriteName = "DamageIcon"; } else { this.InfoLabel.text = (item as Armor).ArmorValue.ToString("N0"); this.InfoIcon.spriteName = "ArmorIcon"; } this.owner = owner; this.item = item; this.itemCategory = itemCategory; }