public void Equip(EquippableItem item) { if (inventory.removeItem(item)) { EquippableItem previousItem; if (equipmentPanel.addItem(item, out previousItem)) { if (previousItem != null) { inventory.addItem(previousItem); } } else { inventory.addItem(item); } } }
public void Equip(Item equippingItem) { if (inventoryREF.removeItem(equippingItem)) { Item previousItem; if (equipmentPanelREF.addItem(equippingItem, out previousItem)) { if (previousItem != null) { inventoryREF.addItem(previousItem); previousItem.Unequip(AllyStatsREF); } equippingItem.Equip(AllyStatsREF); CharDetailedMenuControllerREF.RefreshStats(AllyStatsREF); } else { inventoryREF.addItem(equippingItem); } } }