Example
if(number > 0 && number <20)
{
// Here I want to change the texture
}
I must show the way of the texture? I do not know how to do, help! Sorry My bad english!
Example
if(number > 0 && number <20)
{
// Here I want to change the texture
}
I must show the way of the texture? I do not know how to do, help! Sorry My bad english!
Usually the easiest way is like this:
Texture2D newTexture;
...
// change the texture on only this object:
if ( number > 0 && number < 20 ) {
renderer.material.mainTexture = newTexture;
}
// change the texture in the material:
// (this will affect all objects with this material)
renderer.sharedMaterial.mainTexture = newTexture;
More details on the Material page.