using UnityEngine;
using System.Collections;

public class lightFlickering : MonoBehaviour {

	public Light flickerLight;
	public float highestIntensity;
	public float lowerstIntensity;
	public float flickerRate;
	
	// Use this for initialization
	void Start () {
		
	}


	void Update() {
		if (Random.value > (1f - flickerRate)) {
			FlickerLight();
		}
	}
	
	void FlickerLight() {
		flickerLight.intensity = Random.value * highestIntensity + lowerstIntensity;
	}


}
