Files
3d-bxqz/Assets/Tazo_fx/Script/AnimatedUVs.cs
2026-05-06 17:36:41 +08:00

24 lines
620 B
C#

using UnityEngine;
using System.Collections;
namespace TazoScript
{
public class AnimatedUVs : MonoBehaviour
{
public float speedY = 0.5F;
public float speedx = 0.0F;
private float offsety = 0.0F;
private float offsetx = 0.0F;
private Renderer rend;
void Start()
{
rend = GetComponent<Renderer>();
}
void Update()
{
offsety += Time.deltaTime * speedY;
offsetx += Time.deltaTime * speedx;
rend.material.SetTextureOffset("_MainTex", new Vector2(offsetx, offsety));
}
}
}