Accessing multiple texture materials on objects

How to get to and modify the separate parts of a multi textured object ? For example, I have a tapered cube created in my 3D modeling app. The 6 sides have all been separately assigned textures, named Topside, Bottomside, Left, Right, Front and Back. All of these are re-created as Materials when exported to Unity.

In Unity, how can I access e.g the Front Material and change it’s Color property from within a script ?

If you want to access each material on your object, you can use something like this…

function Awake()
{
	var materials:Array=renderer.materials;

	if(tag=="Enemy")
	{
		materials[0].color=Color.black;
		materials[1].color=Color.red;
	}
}

I stumbled on this post and figured i add my 2 cents(or materials in this case)

The import process should have created 6 different Materials right? So you just change them like this http://unity3d.com/support/documentation/ScriptReference/Material-color.html

Front.color = new Color(.2,.5,.1);

You can access the materials like this
http://unity3d.com/support/documentation/ScriptReference/Renderer-materials.html

So for example:

var mats = go.renderer.materials;
for (mat in mats) {
    mat.color = Color.red; 
}