using UnityEngine;
using System.Collections;
public class UVScroll : MonoBehaviour {
public float SpeedX;
public float SpeedY;
public float Direction;
private Material material;
private float deltX;
private float deltY;
void Start () {
material = GetComponent<Renderer>().material;
}
void Update () {
if (material)
{
deltX += SpeedX * Time.deltaTime * Direction;
deltY += SpeedY * Time.deltaTime * Direction;
material.SetTextureOffset("_MainTex", new Vector2(deltX, deltY));
}
}
}
Unity简单修改UV的动画脚本
最新推荐文章于 2024-05-08 20:53:02 发布