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

public class Target : MonoBehaviour {
    private float health = 100f;

    public float Health {
        get => health;
        set => health = value;
    }

    public void takeDamage(float amout,Transform from) {
        health -= amout;
        if (health <= 0f) {
            die(from);
        }
    }

    protected virtual void die(Transform from) {
        Destroy(this);
    }
}
