using UnityEngine;
using System.Collections;

public class UVScroll : MonoBehaviour {
	
	
	private Vector2[] uvs;
	
	private Mesh meshy;
	
	public Vector2 blah;
	
	// Use this for initialization
	void Start () {
		meshy = GetComponent<MeshFilter>().mesh;
        uvs = GetComponent<MeshFilter>().mesh.uv;//new Vector2[GetComponent<MeshFilter>().mesh.uv.Length];
        
	}
	
	// Update is called once per frame
	void Update () {
		
		for (int i=0; i<uvs.Length; i++){
			uvs[i].x += blah.x * Time.deltaTime;
			uvs[i].y += blah.y * Time.deltaTime;
		}
		
		meshy.uv = uvs;
	}
}
