UseConsummable()

Found in:

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
    }


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *