使用RawImage更改UV实现循环播放画面

需要实现的是波形图

使用RawImage更改UV实现循环播放画面

 

需要先更改波形图片设置 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);
    }
}

 

使用RawImage更改UV实现循环播放画面

上一篇:02_Servlet规范


下一篇:摄影技巧:教你如何调整快门时间