using UnityEngine;
using System.Collections;

public class EnemyHealth : MonoBehaviour
{
	public float enemyHealth;

	public GameObject deathEffect;

	// Use this for initialization
	void Start ()
	{
	
	}
	
	// Update is called once per frame
	void Update ()
	{
		if (enemyHealth <= 0f)
		{
			Instantiate(deathEffect, transform.position, transform.rotation);
			Destroy (gameObject);
		}	
	}

	public void giveDamage(float damageToGive)
	{
		enemyHealth -= damageToGive;
	}

	public float getHealth()
	{
		return enemyHealth;
	}
}
