using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LightFlicker : MonoBehaviour {

	[SerializeField] Vector2 _intensityRange;
	[SerializeField] Light _light;
	[SerializeField] float _intensitySmooth = 5;
	float _intensityTarget;

	void Update(){
		if(_light != null){
			_intensityTarget = Random.Range(_intensityRange.x, _intensityRange.y);
			_light.intensity = Mathf.Lerp(_light.intensity, _intensityTarget, _intensitySmooth * Time.deltaTime);
		}
	}
}
