using UnityEngine;
using System.Collections;

public class LightFlickerScript : MonoBehaviour {

	private bool lightFlickedOn = false;
	private float countdownToNextFlick = 0.0f;
	private float minFlickTime = 0.025f;
	private float maxFlickTime = 0.3f;

	// Use this for initialization
	void Start () {
		gameObject.light.enabled = false;
		countdownToNextFlick = Random.Range(minFlickTime, maxFlickTime);
	}
	
	// Update is called once per frame
	void Update () {
	
		countdownToNextFlick -= Time.deltaTime;

		if(countdownToNextFlick <= 0.0f){
			gameObject.light.enabled = !gameObject.light.enabled;
			countdownToNextFlick = Random.Range(minFlickTime, maxFlickTime);
		}

	}


}
