using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BaseAlly : MonoBehaviour, TargetWithLifeThatNotifies.IDeathNotifiable
{
    public bool IsBeingAttacked = false;
    protected bool Dead = false;

    void TargetWithLifeThatNotifies.IDeathNotifiable.NotifyDeath()
    {
        if(!Dead)
        {
            Dead = true;
            GetComponentInParent<CircleCollider2D>().enabled = false;
            Invoke("Death", 1.2f);
        }


    }
    protected virtual void Death()
    {
        Destroy(transform.parent.gameObject);
    }
}
