Using for ... var ... in loop to access variable.

I’m trying to draw the variable number that every cube has but it’s not working. The cubes are instantiated and the variable is set in the cubes randomly. I tried drawing cube.transform position and that worked. I also tried cube.transform.number. I think i don’t know how to access the variable correctly.

function OnGUI() 
{
cube = GameObject.FindGameObjectsWithTag("Cube");
for (var cube in cube)
{
var ray : Vector3 = camera.WorldToScreenPoint (cube.transform.position);
GUI.Label (Rect(ray.x-16,ray.y+16,ray.x+16,ray.y+32), ""+cube.number);
}
}

GameObject has no variable “number”, it’s in your own script so inside the loop you have to get it from cube.GetComponent(YourScriptName).number