// Made with Amplify Shader Editor v1.9.2.2
// Available at the Unity Asset Store - http://u3d.as/y3X 
Shader "Flipbook"
{
	Properties
	{
		_Tex("Tex", 2D) = "white" {}
		[HideInInspector] _texcoord( "", 2D ) = "white" {}
		[HideInInspector] __dirty( "", Int ) = 1
	}

	SubShader
	{
		Tags{ "RenderType" = "Transparent"  "Queue" = "Transparent+0" "IgnoreProjector" = "True" "IsEmissive" = "true"  }
		Cull Off
		ZWrite Off
		Blend OneMinusDstColor One , SrcAlpha OneMinusSrcAlpha
		
		CGPROGRAM
		#pragma target 3.0
		#pragma surface surf Unlit keepalpha noshadow 
		#undef TRANSFORM_TEX
		#define TRANSFORM_TEX(tex,name) float4(tex.xy * name##_ST.xy + name##_ST.zw, tex.z, tex.w)
		struct Input
		{
			float4 uv_texcoord;
		};

		uniform sampler2D _Tex;

		inline half4 LightingUnlit( SurfaceOutput s, half3 lightDir, half atten )
		{
			return half4 ( 0, 0, 0, s.Alpha );
		}

		void surf( Input i , inout SurfaceOutput o )
		{
			// *** BEGIN Flipbook UV Animation vars ***
			// Total tiles of Flipbook Texture
			float fbtotaltiles7 = 3.0 * 3.0;
			// Offsets for cols and rows of Flipbook Texture
			float fbcolsoffset7 = 1.0f / 3.0;
			float fbrowsoffset7 = 1.0f / 3.0;
			// Speed of animation
			float fbspeed7 = _Time[ 1 ] * 0.0;
			// UV Tiling (col and row offset)
			float2 fbtiling7 = float2(fbcolsoffset7, fbrowsoffset7);
			// UV Offset - calculate current tile linear index, and convert it to (X * coloffset, Y * rowoffset)
			// Calculate current tile linear index
			float fbcurrenttileindex7 = round( fmod( fbspeed7 + i.uv_texcoord.z, fbtotaltiles7) );
			fbcurrenttileindex7 += ( fbcurrenttileindex7 < 0) ? fbtotaltiles7 : 0;
			// Obtain Offset X coordinate from current tile linear index
			float fblinearindextox7 = round ( fmod ( fbcurrenttileindex7, 3.0 ) );
			// Multiply Offset X by coloffset
			float fboffsetx7 = fblinearindextox7 * fbcolsoffset7;
			// Obtain Offset Y coordinate from current tile linear index
			float fblinearindextoy7 = round( fmod( ( fbcurrenttileindex7 - fblinearindextox7 ) / 3.0, 3.0 ) );
			// Reverse Y to get tiles from Top to Bottom
			fblinearindextoy7 = (int)(3.0-1) - fblinearindextoy7;
			// Multiply Offset Y by rowoffset
			float fboffsety7 = fblinearindextoy7 * fbrowsoffset7;
			// UV Offset
			float2 fboffset7 = float2(fboffsetx7, fboffsety7);
			// Flipbook UV
			half2 fbuv7 = i.uv_texcoord.xy * fbtiling7 + fboffset7;
			// *** END Flipbook UV Animation vars ***
			float4 tex2DNode8 = tex2D( _Tex, fbuv7 );
			o.Emission = tex2DNode8.rgb;
			o.Alpha = tex2DNode8.a;
		}

		ENDCG
	}
	CustomEditor "ASEMaterialInspector"
}
/*ASEBEGIN
Version=19202
Node;AmplifyShaderEditor.TextureCoordinatesNode;3;-683,147;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.TexturePropertyNode;5;-690,-43;Inherit;True;Property;_Tex;Tex;0;0;Create;True;0;0;0;False;0;False;None;cf24447feba4eb343b5aa42a7004947f;False;white;Auto;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
Node;AmplifyShaderEditor.TexCoordVertexDataNode;4;-683,278;Inherit;False;0;4;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.BreakToComponentsNode;6;-88,105;Inherit;False;COLOR;1;0;COLOR;0,0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;171,-10;Float;False;True;-1;2;ASEMaterialInspector;0;0;Unlit;Flipbook;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;False;False;False;Off;2;False;;0;False;;False;0;False;;0;False;;False;0;Custom;0.5;True;False;0;False;Transparent;;Transparent;All;12;all;True;True;True;True;0;False;;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;2;15;10;25;False;0.5;False;5;4;False;;1;False;;2;5;False;;10;False;;0;False;;0;False;;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;True;Relative;0;;1;-1;-1;-1;0;False;0;0;False;;-1;0;False;;0;0;0;False;0.1;False;;0;False;;False;16;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;16;FLOAT4;0,0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
Node;AmplifyShaderEditor.FunctionNode;2;-383,51;Inherit;False;Flipbook;-1;;1;53c2488c220f6564ca6c90721ee16673;6,161,1,71,1,68,0,164,1,162,1,163,1;10;51;SAMPLER2D;0.0;False;167;SAMPLERSTATE;0;False;13;FLOAT2;0,0;False;24;FLOAT;0;False;4;FLOAT;3;False;5;FLOAT;3;False;130;FLOAT;30;False;2;FLOAT;0;False;55;FLOAT;0;False;70;FLOAT;0;False;5;COLOR;53;FLOAT2;0;FLOAT;47;FLOAT;48;FLOAT;62
Node;AmplifyShaderEditor.SamplerNode;8;-209,-122;Inherit;True;Property;_TextureSample0;Texture Sample 0;2;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.TFHCFlipBookUVAnimation;7;-439,413;Inherit;False;0;0;6;0;FLOAT2;0,0;False;1;FLOAT;3;False;2;FLOAT;3;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;3;FLOAT2;0;FLOAT;1;FLOAT;2
WireConnection;6;0;2;53
WireConnection;0;2;8;0
WireConnection;0;9;8;4
WireConnection;2;51;5;0
WireConnection;2;167;5;1
WireConnection;2;13;3;0
WireConnection;2;2;4;3
WireConnection;8;0;5;0
WireConnection;8;1;7;0
WireConnection;8;7;5;1
WireConnection;7;0;3;0
WireConnection;7;4;4;3
ASEEND*/
//CHKSM=BFD710AF8A9BBB0C105F53702FA1B10D78103C95