Load Texture

dears,

helo guys,i need your help.

i new bee and want to learn more about unity3d engine.

i have a proble.

i want change object texure.
if i touch botton change " random collor ",object “teapot” will be change collor texure.from red to green.

how to do that…?

pleae i need your help.

Thank You
Razip Musa

you would alter the corresponding texture on the Material

dears dreamora,

thanks for your reply…

but i mean is,did u have example script for my problem…

i dont now,what a keyword must i seacrh in unity guide.

maybe you can help me in detail…

Thank You
Razip Musa

Is something like this what you had in mind?

var target: Transform;
var useGreen: boolean;


function OnGUI () {
	if (GUI.Button(new Rect(10, 10, 80, 30), "Change")) {
		if (useGreen) {
			target.renderer.material.color = Color.green;
			useGreen = false;
		} else {
			target.renderer.material.color = Color.red;
			useGreen = true;
		}
	}
}