需要实现的是波形图
需要先更改波形图片设置 Wrap Mode为Repeat模式
using UnityEngine; using System.Collections; using UnityEngine.UI; public class offectuv : MonoBehaviour { float x ; public float speed=0.01f; public RawImage myRaw; void Start () { x = myRaw.uvRect.x; } // Update is called once per frame void Update() { if (x <= -1f) { x = 0; x = x - speed; } else { x = x - speed; } myRaw.uvRect = new Rect(x, 0, 1, 1); } }