using UnityEngine; using System.Collections; public class LightToggler : MonoBehaviour { [RangeAttribute(0.01f, 20.0f)] public float toggleEvery = 1; private float _lastToggle; // Use this for initialization void Start () { } // Update is called once per frame void Update () { if (Time.time - _lastToggle > toggleEvery) { Light light = GetComponent (); light.enabled = !light.enabled; _lastToggle = Time.time; } } }