流动的线,可修改背景色及图标纹理的线型图标及颜色,图标主色可为白色,背景透明


替换图片即可改变线型喽

Shader "Custom/mvline"
{
    Properties
    {
		_BgColor("BgColor", Color) = (1,1,1,1)
		_Color("Color",Color)=(1,1,1,1)
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
	    _Dir("Direction",Range(-1,1)) = -1
	    _Speed("Speed",Range(-10,10)) = 2
    }
    SubShader
    {
		Tags{ "RenderType" = "Opaque" }
		LOD 200
		CGPROGRAM
		// Physically based Standard lighting model, and enable shadows on all light types
		#pragma surface surf Standard fullforwardshadows

		// Use shader model 3.0 target, to get nicer looking lighting
		#pragma target 3.0
        struct Input
		{
			float2 uv_MainTex;
		};
		fixed4 _BgColor;
		fixed4 _Color;
		sampler2D _MainTex;
        float _Dir;
		float _Speed;
		
		void surf(Input IN, inout SurfaceOutputStandard o)
		{
			float2 tep = IN.uv_MainTex;

			tep.x += _Time.y*_Speed*_Dir;
			fixed4 temp=tex2D(_MainTex, tep)*abs(_Dir);
			fixed4 c=(1-temp) *_BgColor+temp*_Color*1.2;
			o.Albedo = c.rgb;
			o.Alpha = c.a;
		}
		ENDCG
    }
    FallBack "Diffuse"
} 

你可能感兴趣的:(UnityShader,unity)