![unity3d 纹理贴图循环运动 - 重庆unity3d - unity3d工作室](https://www.evernote.com/shard/s175/res/83ac57bd-7fca-45e6-ab24-d06ff56bbd5a.jpg?resizeSmall&width=786)
![unity3d 纹理贴图循环运动 - 重庆unity3d - unity3d工作室](https://www.evernote.com/shard/s175/res/1b9519b0-227f-4082-8cf9-53fee9c34e89.jpg?resizeSmall&width=786)
![unity3d 纹理贴图循环运动 - 重庆unity3d - unity3d工作室](https://www.evernote.com/shard/s175/res/f2ce2863-3bfe-4302-a2a5-7f6436e6f2c3.jpg?resizeSmall&width=786)
用法很简单,把这个脚本放在有贴图的gameobject上就可以了
贴图最好用psd格式的,jpg格式的不行
#pragma strict
// Scroll main texture based on time
var scrollSpeed = -0.5;
// This must be set to override a bug where Render Order
// of the tunnel objects is lost when SetTextureOffset is used
var queue = 0;
private var offset = 0.0;
function Update ()
{
offset = Time.time * scrollSpeed;
renderer.material.SetTextureOffset ("_MainTex", Vector2(offset,0));
renderer.material.renderQueue = queue;
}