public void UseConsummable()
{
PointerEventData pointer = new PointerEventData(EventSystem.current);
ItemScriptableObject consummableItem;
if (pointer.lastPress.TryGetComponent(out Image img))
{
consummableItem = collectedItems.Find(item => item.icon == img.sprite);
}
else return;
if (consummableItem && consummableItem.consummable)
{
cardTemplate.hero.HealDamage(consummableItem.damage);
}
//pointer.lastPress.gameObject.GetComponent
}

Leave a Reply