how do I animate a texture when using a model (ex. a plane) ?
This is an example using SetTextureOffset
:
[Unity - Scripting API: Material.SetTextureOffset][1]
This is an example for swapping the UV’s of the mesh verts.
#pragma strict
public var scrollSpeed : float = 0.1;
function Update()
{
SwapUVs();
}
function SwapUVs()
{
var mesh : Mesh = this.transform.GetComponent(MeshFilter).mesh;
var uvSwap : Vector2[] = mesh.uv;
for (var b:int = 0; b < uvSwap.length; b ++)
{
uvSwap __+= Vector2( scrollSpeed * Time.deltaTime, 0 );__
}
mesh.uv = uvSwap;
}
[1]: Unity - Scripting API: Material.SetTextureOffset