void Update() { counter += Time.deltaTime; if (duration > 0 && counter >= random) { duration -= Time.deltaTime; } if (duration <= 0 && counter >= random) { if (Proc != null) { Proc.Flicker("off"); Proc.TurnLights("on"); } counter = 0.0f; random = 0.0f; if (continuous) { duration = _duration; } } if (random == 0.0f) { random = UnityEngine.Random.Range(minimum, maximum); } if (counter >= random) { if (Proc != null) { Proc.Flicker("on"); Proc.TurnLights("off"); } } }