Material.SetTextureScale Manual     Reference     Scripting  
Scripting > Runtime Classes > Material
Material.SetTextureScale

function SetTextureScale (propertyName : String, scale : Vector2) : void

Description

Sets the placement scale of texture propertyName.

Common texture names used by Unity's builtin shaders:
"_MainTex" is the main diffuse texture. This can also be accessed via mainTextureScale property.
"_BumpMap" is the normal map.
"_Cube" is the reflection cubemap.

See Also: mainTextureScale property, GetTextureScale.

JavaScript
function Update () {
// Animates main texture scale in a funky way!
var scaleX : float = Mathf.Cos (Time.time) * 0.5 + 1;
var scaleY : float = Mathf.Sin (Time.time) * 0.5 + 1;
renderer.material.SetTextureScale ("_MainTex", Vector2(scaleX,scaleY));
}