using UnityEngine;

public class EnemyHitbox : MonoBehaviour
{
    private Entity owner;
    
    private void Awake()
    {
        owner = GetComponentInParent<Entity>();
    }

    private void OnTriggerEnter2D(Collider2D other)
    {
        Player player = other.GetComponent<Player>();
        if (player == null)
        {
            return;
        }

        owner.OnHitPlayer(player);
    }
}