using UnityEngine;
using System.Collections;
public class AnimatedUVs : MonoBehaviour
{
public int materialIndex = 0;
public Vector2 uvAnimationRate = new Vector2( 1.0f, 0.0f );
public string textureName = "_MainTex";
Vector2 uvOffset = Vector2.zero;
//unity3d脚本http://www.unitymanual.com/
void LateUpdate()
{
uvOffset += ( uvAnimationRate * Time.deltaTime );
if( renderer.enabled )
{
renderer.materials[ materialIndex ].SetTextureOffset( textureName, uvOffset );
}
}
}
Unity3D动画贴图、滚动纹理、滚动贴图脚本
最新推荐文章于 2023-10-31 22:56:14 发布