﻿using UnityEngine;
using System.Collections;


public class TextureScroller : MonoBehaviour
{
	public float speed = 2f;
	private Renderer m_Renderer;


	void Start()
	{
		m_Renderer = GetComponent<Renderer>();
	}
	
	void Update ()
	{
		var offset = m_Renderer.material.mainTextureOffset - (Vector2.right * speed * Time.deltaTime);
		m_Renderer.material.SetTextureOffset("_BumpMap", offset);
		m_Renderer.material.mainTextureOffset = offset;
	}
}
