using System;
using UnityEngine;

[RequireComponent(typeof(BoxCollider))]
public class HealthPickUp : MonoBehaviour, IPickable
{
    public PickUpType type => PickUpType.Health;

    public void OnTriggerEnter(Collider other)
    {
        PickObject(other.gameObject);
    }

    public void PickObject(GameObject obj)
    {
        obj.GetComponent<CharacterCondition>()?.GiveHealth(SettingsReader.Instance.GetSettings.healthPickupAmount);
        gameObject.SetActive(false);
    }
}
