using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class EnemyHealthBar : MonoBehaviour
{
	public Slider slider;

	public GameObject enemy;

	// Use this for initialization
	void Start ()
	{
		slider.value = 1f;
	}

	// Update is called once per frame
	void Update ()
	{
		if (enemy != null)
		{
			slider.value = enemy.GetComponent<EnemyHealth> ().getHealth () / 6000f;
		}
	}
}
