using UnityEngine; using System.Collections; public class SideTextureRotationTest : MonoBehaviour { // Use this for initialization void Start () { GetComponent().material.mainTexture.wrapMode = TextureWrapMode.Repeat; } // Update is called once per frame void Update () { Vector2 offset = new Vector2( -(transform.eulerAngles.y/180), 0 ); GetComponent().material.SetTextureOffset("_MainTex", offset); } }