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

public class BlinkUIText : MonoBehaviour {
	public float BlinkOnTime;
	public float BlinkOffTime;

	public bool On;

	Text thisText;

	void Awake () {
		thisText = GetComponent<Text> ();

		StartCoroutine(Blink());
	}
	
	public IEnumerator Blink ()
	{
		while (true) {
			float s = BlinkOnTime;
			On = !On;
			if (On) {
				thisText.enabled = true;
			} else {
				thisText.enabled = false;
				s = BlinkOffTime;
			}
			yield return new WaitForSeconds (s);
		}
	}
}
