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

public class DestroyableObject : MonoBehaviour
{
    [SerializeField] public int health;

    // Decrement health and returns true if health turned to zero
    public bool TakeDamage(int damage)
    {
        health -= damage;
        if(health <= 0)
        {
            Destroy(gameObject);
            return true;
        }
        return false;
    }

    public void Kill()
    {
        Destroy(gameObject);
    }
}
