一。通过修改UV坐标实现滚动
```csharp
Shader "Custom/ScrollingUVs" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_ScrollXSpeed("X Scroll Speed",Range(0,10))=2
_ScrollYSpeed("Y Scroll Speed",Range(0,10))=2
}
SubShader {
Tags{"RenderType"="Opaque"}
LOD 200
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
float _ScrollXSpeed;
float _ScrollYSpeed;
struct Input{
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o)
{
float2 scrolledUv=IN.uv_MainTex;
float xscrollValue=_ScrollXSpeed*_Time.y;
float yscrollValue=_ScrollYSpeed*_Time.y;
scrolledUv+=fixed2(xscrollValue,yscrollValue);
half4 c=tex2D(_MainTex,scrolledUv);
o.Albedo=c.rgb;
o.Alpha=c.a;
}
ENDCG
}
FallBack "Diffuse"
}