using Nan.Scripts;
using UnityEngine;

public class RecoverItem : MonoBehaviour
{
    [SerializeField] private AudioSource _audioSource;

    public float RecoverHealth
    {
        get { return 0.5f; }
    }

    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.GetComponent<PlayerControl>() == null) return;
        _audioSource.transform.SetParent(null);
        Destroy(_audioSource.gameObject, 1);
        _audioSource.Play();
        Destroy(gameObject);
        ScoreManager.Instance.AddScore(500, transform.position);
    }
}
