/* * Checks if the target object is in the list of objects lit by this light source * Activates if lit state has changed */ void CheckForObject() { List <GameObject> litObjects = lightSource.GetLitObjects(); bool lit = litObjects.Contains(targetObject); if (lit != targetIsLit) { targetIsLit = lit; ActivateTriggers(targetIsLit); } }