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

public class hptest : MonoBehaviour {

Image hp;
float point;

// Use this for initialization
void Start () {
hp = GetComponent<Image>();
}

// Update is called once per frame
void Update () {
if (point < 1f) {
point += 0.5f * Time.deltaTime;
} else {
point = 0f;
}
hp.fillAmount = point;
}
}