using System;
using UnityEngine;

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

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

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