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; }
private void SwitchItemCategory(EquipmentManager.ItemCategory newCategory) { if (this.currentCategory == newCategory) { return; } this.currentCategory = newCategory; this.Scrollbar.value = 0f; for (int i = 0; i < this.listOfWeapons.Count; i++) { this.listOfWeapons[i].SetActive(this.currentCategory == EquipmentManager.ItemCategory.Weapon); } for (int i = 0; i < this.listOfArmors.Count; i++) { this.listOfArmors[i].SetActive(this.currentCategory == EquipmentManager.ItemCategory.Armor); } for (int i = 0; i < this.listOfBoots.Count; i++) { this.listOfBoots[i].SetActive(this.currentCategory == EquipmentManager.ItemCategory.Boots); } for (int i = 0; i < this.listOfBoots.Count; i++) { this.listOfHelmets[i].SetActive(this.currentCategory == EquipmentManager.ItemCategory.Helmet); } }