var allLights : Light;
function Start () {
allLights = GetComponentsInChildren(Light) as Light[];
Debug.Log(allLights);
}
This script is attached to a gameObject (Semaphore Regulator) with the next children structure (you can also see the console output for the debug):
You are currently using Component.GetComponentsInChildren. You need to use GameObject.GetComponentsInChildren() as:
allLights = gameObject.GetComponentsInChildren(Light) as Light[];
The main difference as in the documentation page for GameObject.GetComponentsInChildren() states that:
The search for components is carried
out recursively on child objects, so
it includes children of children, and
so on.
Which is what you need as your lights are children of children of your Semaphore Regulator game object.