IEnumerator Flick() { float nextInterval; while (on) { nextInterval = RandomInterval(); Douple douple = Randomize(); SetAttributes(me, douple); if (children.Count > 0) { foreach (Light spookyLight in children) { SetAttributes(spookyLight, douple); } } yield return(new WaitForSeconds(nextInterval)); } }
void SetAttributes(Light spookyLight, Douple input) { spookyLight.intensity = input.intensity; spookyLight.range = input.range; }