public void SellItem(int id) { if (currentWares != null && id >= 0 && id < currentWares.ownedGear.Count) { GearSlot gearSlot = currentWares.ownedGear[id]; gearSlot.isEquipped = false; InventoryObject.ExchangeItemForCurrency(gearSlot, currentWares, currentWares.mainCurrency); //Update UI: EmptySlot(id); GenerateIcons(); if (this.name == "ShopMenu") { Debug.Log("UI updated: " + this.name); } } else { //Debug.Log("It's an empty slot..."); } }