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;
 
    void LateUpdate() 
    {
        uvOffset += ( uvAnimationRate * Time.deltaTime );
        if( renderer.enabled )
        {
            renderer.materials[ materialIndex ].SetTextureOffset( textureName, uvOffset );
        }
    }
}

相关文章:

  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
  • 2021-11-29
  • 2021-04-04
  • 2022-01-10
  • 2022-01-07
  • 2021-05-09
猜你喜欢
  • 2021-12-29
  • 2022-12-23
  • 2021-09-21
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-06-11
相关资源
相似解决方案