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

public class Circle : MonoBehaviour 
{
    public GameObject goBlackhole;

    [SerializeField]
    Color start;
    [SerializeField]
    Color end;

    [SerializeField]
    Material CircleMaterial;

    Blackhole bh { get { return goBlackhole.GetComponent<Blackhole>(); } }

	// Update is called once per frame
	void Update () 
    {
        CircleMaterial.SetFloat("_Angle", Mathf.Lerp(-3.14f, 3.14f, bh.currentHP/100f));
        CircleMaterial.SetColor("_Color", Color.Lerp(start, end, bh.currentHP/100f));
	}
}
