private void UpdateUIAndApplyStats(Item item) { Armor armor = null; Weapon weapon = null; if (item is Armor) { armor = (Armor)item; weapon = null; } if (item is Weapon) { weapon = (Weapon)item; armor = null; } if (weapon == null) { UpdateEquipmentUI(armor, slot.ToString()); //update the UI //Add Item Mesh to the right position -> this.transform armor.ApplyStats(); } if (armor == null) { UpdateEquipmentUI(weapon, slot.ToString()); //update the UI //Add Item Mesh to the right position -> this.transform weapon.ApplyStats(); } }