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

public class HealthBar : MonoBehaviour
{
	public Slider slider;

	public GameObject player;

	// Use this for initialization
	void Start ()
	{
		slider.value = 1f;
	}
	
	// Update is called once per frame
	void Update ()
	{
		if (player != null)
		{
			slider.value = player.GetComponent<PlayerHealth> ().getHealth () / 3000f;
		}
	}
}
