From 5ae084489a5ed294258e4808522e5b5d9460d481 Mon Sep 17 00:00:00 2001 From: wulongxiao <2545507770@qq.com> Date: Wed, 20 Nov 2024 15:01:45 +0800 Subject: [PATCH] add --- .../res/Battle_Royale_UI/End/ScrollShader.mat | 81 +++++++++++++++++++ .../End/ScrollShader.mat.meta | 8 ++ .../Battle_Royale_UI/End/ScrollShader.shader | 66 +++++++++++++++ .../End/ScrollShader.shader.meta | 10 +++ 4 files changed, 165 insertions(+) create mode 100644 TheStrongestSnail/Assets/res/Battle_Royale_UI/End/ScrollShader.mat create mode 100644 TheStrongestSnail/Assets/res/Battle_Royale_UI/End/ScrollShader.mat.meta create mode 100644 TheStrongestSnail/Assets/res/Battle_Royale_UI/End/ScrollShader.shader create mode 100644 TheStrongestSnail/Assets/res/Battle_Royale_UI/End/ScrollShader.shader.meta diff --git a/TheStrongestSnail/Assets/res/Battle_Royale_UI/End/ScrollShader.mat b/TheStrongestSnail/Assets/res/Battle_Royale_UI/End/ScrollShader.mat new file mode 100644 index 0000000..f0a73e2 --- /dev/null +++ b/TheStrongestSnail/Assets/res/Battle_Royale_UI/End/ScrollShader.mat @@ -0,0 +1,81 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ScrollShader + m_Shader: {fileID: 4800000, guid: 0524dc31955a45d40bbe4c2d348490a4, type: 3} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 240.79} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: faf33e830c8b5e74bbe7b5ae33f689c9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _ScrollSpeedY: -0.38 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/TheStrongestSnail/Assets/res/Battle_Royale_UI/End/ScrollShader.mat.meta b/TheStrongestSnail/Assets/res/Battle_Royale_UI/End/ScrollShader.mat.meta new file mode 100644 index 0000000..b8d1e75 --- /dev/null +++ b/TheStrongestSnail/Assets/res/Battle_Royale_UI/End/ScrollShader.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bfcd795f1f359a64d80bf34e0ad8485d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/res/Battle_Royale_UI/End/ScrollShader.shader b/TheStrongestSnail/Assets/res/Battle_Royale_UI/End/ScrollShader.shader new file mode 100644 index 0000000..f0a0847 --- /dev/null +++ b/TheStrongestSnail/Assets/res/Battle_Royale_UI/End/ScrollShader.shader @@ -0,0 +1,66 @@ +Shader "Custom/ScrollShader" +{ + Properties + { + _MainTex ("Texture", 2D) = "white" {} + _ScrollSpeedY ("Scroll Speed Y", Float) = 1.0 + _Color ("Tint Color", Color) = (1, 1, 1, 1) + } + SubShader + { + Tags { "RenderType"="Transparent" "Queue"="Transparent" } + LOD 100 + + Blend SrcAlpha OneMinusSrcAlpha + ZWrite Off + Cull Off + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + struct appdata_t + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + }; + + sampler2D _MainTex; + float4 _MainTex_ST; + float _ScrollSpeedY; + float4 _Color; + + v2f vert (appdata_t v) + { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + + // Adjust UV coordinates to scroll in the Y direction + float scrollY = _Time.y * _ScrollSpeedY; + o.uv = v.uv; + o.uv.y += scrollY; + + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + // Sample the texture using the updated UV coordinates + fixed4 col = tex2D(_MainTex, i.uv) * _Color; + return col; + } + ENDCG + } + } + FallBack "Transparent/Diffuse" +} diff --git a/TheStrongestSnail/Assets/res/Battle_Royale_UI/End/ScrollShader.shader.meta b/TheStrongestSnail/Assets/res/Battle_Royale_UI/End/ScrollShader.shader.meta new file mode 100644 index 0000000..86b5777 --- /dev/null +++ b/TheStrongestSnail/Assets/res/Battle_Royale_UI/End/ScrollShader.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b908e50deff2bc9428cf43e58c588b2c +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: