AnimatedUVs.cs 336 B

1234567891011121314
  1. using UnityEngine;
  2. using System.Collections;
  3. public class AnimatedUVs : MonoBehaviour {
  4. public float scrollSpeed = 0.5F;
  5. public Renderer rend;
  6. void Start() {
  7. rend = GetComponent<Renderer>();
  8. }
  9. void Update() {
  10. float offset = Time.time * scrollSpeed;
  11. rend.material.SetTextureOffset("_MainTex", new Vector2(offset, 0));
  12. }
  13. }