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

public class LightIntensityOverTime : MonoBehaviour
{
    public Light light;
    public float intensity;
    public float speed;

    public void GodLight()
    {
        StartCoroutine(GodLightCO());
    }

    private IEnumerator GodLightCO()
    {
        while (light.intensity < intensity)
        {
            light.intensity = Mathf.Lerp(light.intensity, intensity, speed * Time.deltaTime);
            yield return null;
        }
    }
}
