Hi,
I’m sure it’s stupid, but I can’t manage to work this out.
I’ve got and object with 3 different materials, a gui button and 2 textures.
I want to switch the diffuse texture of the second material between my two textures every time I click.
Everything is set up except I don’t know how to select the second material…
I can"t find it in the script ref
public static bool T = true;
public Material Ground;
public Texture Real;
public Texture Map;
private Texture textureAlpha;
if (T == true) {
textureAlpha = Real;
}
else if (T == false) {
textureAlpha = Map;
}
renderer.material.SetTexture("_MainTex", textureAlpha);
This script works for an object with one material.
Thank’s for the help
Boobi