I'm instantiating a grid of cloned objects and need to apply a different texture to each depending on the values in a multidimensional array from a script attached to the main camera. I'm a bit rusty and can't remember how to give each instantiated object the appropriate texture. Can someone please help me out?
for (var y = 0; y < gridY; y++) {
for (var x=0;x < gridX; x++) {
var pos = Vector3 (x + gridOffset, 0, y + gridOffset) * spacing;
currTile = GS_Games[gameNum, y, x];
// GS_Pics[currTile] holds the material to be applied
Instantiate(GS_Tile, pos, Quaternion.identity);
}
}