void InventoryRightClick(ItemSlot itemSlot) { if (itemSlot.Item is EquippableItem) { Equip((EquippableItem)itemSlot.Item); } else if (itemSlot.Item is UseableItem) { UseableItem useableItem = (UseableItem)itemSlot.Item; useableItem.Use(GetComponent <Character>()); if (useableItem.IsConsumable) { inventory.RemoveItem(useableItem); useableItem.Destroy(); } } }
public abstract void ExecuteEffect(UseableItem parentItem, Character character);
public override void ExecuteEffect(UseableItem parentItem, Character character) { character.GetComponent <HealthController>().CurrentHealthPoints += healAmount; }