纳金网

标题: Unity3D 物体材质位移代码 [打印本页]

作者: yeu1233    时间: 2012-8-22 11:57
标题: Unity3D 物体材质位移代码









var scrollSpeed = 0.1;

function Update ()

{

    var offset = Time.time * scrollSpeed;

    renderer.material.SetTextureOffset ("_BumpMap", Vector2(offset/-7.0, offset));

   

    renderer.material.SetTextureOffset ("_MainTex", Vector2(offset/10.0, offset));

}







欢迎光临 纳金网 (http://rs.narkii.com/club/) Powered by Discuz! X2.5