Array of textures doesn't works

Hello. Here is my problem:

I have an array of textures to show in a GUI box.

var items : Texture[];
var textura1 : Texture;
var textura2 : Texture;
var textura3 : Texture;
var item1 : Texture;

I asign all textures in the inspector and update them in the array:

function Start(){

items[0]=textura1;
items[1]=textura2;
items[2]=textura3;
item1 = items[1];      // I try to change the index of the array...

}

and I use it…

function OnGUI() {

GUILayout.BeginArea (Rect (0,Screen.height -40,Screen.width,40));
GUILayout.BeginHorizontal();
GUILayout.Box(item1);
}

I cant see any texture.

why?

The point of arrays is that you don’t use a bunch of separate variable names, you just use one array.

var items : Texture[];

function OnGUI() {
    GUILayout.BeginArea (Rect (0,Screen.height -40,Screen.width,40));
    GUILayout.BeginHorizontal();
    GUILayout.Box(items[1]);
}

–Eric

Great!. Thanks you very much. The code now is easyer and it works!