using UnityEngine;
using System.Collections;

public class NewInstructionAlert : MonoBehaviour
	{

	public GameObject light1;
	public GameObject light2;
	public Material on_material;
	public Material off_material;

	IEnumerator sub_blink( float duration )
		{
		float interval = 0.05f;
		float beginTime = Time.time;
		while( beginTime + duration > Time.time)
			{
			light1.renderer.material = on_material;
			light2.renderer.material = off_material;
			yield return new WaitForSeconds (interval);
			light1.renderer.material = off_material;
			light2.renderer.material = on_material;
			yield return new WaitForSeconds (interval);
			}
		light1.renderer.material = off_material;
		light2.renderer.material = off_material;
		}

	public void blink( float duration )
		{
		StartCoroutine( sub_blink(duration) );
		audio.Play();
		}

	void Start ()
		{
		// DEBUG
		//blink(100);
		}

	void Update ()
		{
		}
	}
