using UnityEngine;
using System.Collections;

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