This is an example for swapping the UV's of the mesh vertices.
#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[b] += Vector2( scrollSpeed * Time.deltaTime, 0 );
}
mesh.uv = uvSwap;
}
↧