1_13:@2D界面的表现Shader更新@车辆的检测时间修改

master
GamerHJD 3 years ago
parent 7b37fbf0cf
commit 8cc6553aec

5
.gitignore vendored

@ -5,7 +5,10 @@
/[Mm]esh/
/[Ss]censeMesh/
/Mesh
AmplifyShaderEditor
v16
# Autogenerated VS/MD solution and project files
*.fbx

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@ -0,0 +1,91 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: 2dBackGroud
m_Shader: {fileID: 4800000, guid: 307f72d7bf7622b45b4217ef51e4bf2f, type: 3}
m_ShaderKeywords:
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: 0}
- _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: 0}
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}
- _TextureSample0:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _texcoord:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _MaxAlpha: 0.613
- _Metallic: 0
- _MinAlpha: 0.45
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _Speed: 0.6
- _SrcBlend: 1
- _TexScale: 0.322
- _TilingScale: 62.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}
- _TintColor: {r: 0.84862477, g: 1.0556064, b: 3.9533494, a: 1}

@ -0,0 +1,77 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: 3DBG
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
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: 0}
- _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: 1000, y: 1000}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 7b5c778cf361ce34e9a948464b8bba8a, type: 3}
m_Scale: {x: 1000, y: 1000}
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_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
- _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}

@ -8,9 +8,9 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ColorRoad
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_Shader: {fileID: 4800000, guid: a0ab2173992007b4399aa02dcd1d76a0, type: 3}
m_ShaderKeywords: _EMISSION _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF
m_LightmapFlags: 2
m_LightmapFlags: 6
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
@ -55,23 +55,36 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TextureSample0:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _texcoord:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _ColorIndex: 0
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 0
- _MaxAlpha: 1
- _Metallic: 0
- _MinAlpha: -0.5
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 0
- _Speed: 0.51
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.34743315, g: 1, b: 0.2028302, a: 0.36862746}
- _EmissionColor: {r: 0.12290126, g: 1.3041189, b: 0.047794934, a: 1}
- _TintColor: {r: 0.28583583, g: 1.39772, b: 0.27076244, a: 0.8352941}

@ -0,0 +1,84 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: LightLine
m_Shader: {fileID: 4800000, guid: cfdb8e8314a6b8d41b26eb478c1d7a0e, type: 3}
m_ShaderKeywords:
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: 0}
- _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: b6ca66d1c17b2314986797ad948ba4c6, 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}
- _texcoord:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
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
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _Speed: 0.95
- _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}
- _LightColor: {r: 2.2591257, g: 2.2538178, b: 1.017198, a: 1}
- _Tint: {r: 0.55460125, g: 0.8799367, b: 0.9716981, a: 1}

@ -0,0 +1,167 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "AlphaHuXiBase"
{
Properties
{
_Speed("Speed", Range( 0 , 2)) = 1
_ColorIndex("ColorIndex", Int) = 0
_MinAlpha("MinAlpha", Float) = 0.5
[HDR]_MaxAlpha("MaxAlpha", Float) = 1
}
SubShader
{
Tags { "RenderType"="Transparent" }
LOD 100
CGINCLUDE
#pragma target 3.0
ENDCG
Blend One Zero, SrcAlpha OneMinusSrcAlpha
AlphaToMask On
Cull Back
ColorMask RGBA
ZWrite On
ZTest LEqual
Offset 0 , 0
Pass
{
Name "Unlit"
Tags { "LightMode"="ForwardBase" }
CGPROGRAM
#ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
//only defining to not throw compilation error over Unity 5.5
#define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
#endif
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing
#include "UnityCG.cginc"
#include "UnityShaderVariables.cginc"
struct appdata
{
float4 vertex : POSITION;
float4 color : COLOR;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
float3 worldPos : TEXCOORD0;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
uniform int _ColorIndex;
uniform half _MinAlpha;
uniform half _MaxAlpha;
uniform half _Speed;
v2f vert ( appdata v )
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
float3 vertexValue = float3(0, 0, 0);
#if ASE_ABSOLUTE_VERTEX_POS
vertexValue = v.vertex.xyz;
#endif
vertexValue = vertexValue;
#if ASE_ABSOLUTE_VERTEX_POS
v.vertex.xyz = vertexValue;
#else
v.vertex.xyz += vertexValue;
#endif
o.vertex = UnityObjectToClipPos(v.vertex);
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
#endif
return o;
}
fixed4 frag (v2f i ) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(i);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
fixed4 finalColor;
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
float3 WorldPosition = i.worldPos;
#endif
half4 color28 = IsGammaSpace() ? half4(1.304119,0.3225894,0.266286,1) : half4(1.793486,0.08492619,0.05764138,1);
half4 color3 = IsGammaSpace() ? half4(1.304119,1.201701,0.2662861,1) : half4(1.793486,1.498139,0.05764144,1);
half4 color29 = IsGammaSpace() ? half4(0.5530557,1.304119,0.2321468,1) : half4(0.2664761,1.793486,0.04401935,1);
half mulTime6 = _Time.y * _Speed;
half temp_output_18_0 = abs( sin( mulTime6 ) );
half smoothstepResult31 = smoothstep( _MinAlpha , _MaxAlpha , temp_output_18_0);
finalColor = ( ( (float)_ColorIndex - 0.0 > (float)1 ? color28 : (float)_ColorIndex - 0.0 <= (float)1 && (float)_ColorIndex + 0.0 >= (float)1 ? color3 : color29 ) * smoothstepResult31 );
return finalColor;
}
ENDCG
}
}
CustomEditor "ASEMaterialInspector"
Fallback "Unlit/Color"
}
/*ASEBEGIN
Version=18900
88;172;1253;631;1307.825;-129.9178;1;True;True
Node;AmplifyShaderEditor.RangedFloatNode;12;-1574.224,263.5381;Inherit;False;Property;_Speed;Speed;0;0;Create;True;0;0;0;False;0;False;1;0.51;0;2;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleTimeNode;6;-1216.446,196.771;Inherit;True;1;0;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SinOpNode;30;-1015.355,214.097;Inherit;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.ColorNode;28;-1121.418,-367.9857;Inherit;False;Constant;_TintColor1;TintColor;1;1;[HDR];Create;True;0;0;0;False;0;False;1.304119,0.3225894,0.266286,1;0.2858358,1.39772,0.2707624,0.8352941;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.ColorNode;29;-1115.838,-15.64137;Inherit;False;Constant;_TintColor2;TintColor;1;1;[HDR];Create;True;0;0;0;False;0;False;0.5530557,1.304119,0.2321468,1;0.2858358,1.39772,0.2707624,0.8352941;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.ColorNode;3;-1114.306,-189.6386;Inherit;False;Constant;_TintColor;TintColor;1;1;[HDR];Create;True;0;0;0;False;0;False;1.304119,1.201701,0.2662861,1;0.2858358,1.39772,0.2707624,0.8352941;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.IntNode;26;-1110.86,-625.0836;Inherit;False;Constant;_Int1;Int 1;3;0;Create;True;0;0;0;False;0;False;1;0;False;0;1;INT;0
Node;AmplifyShaderEditor.IntNode;24;-898.3265,-832.2639;Inherit;False;Property;_ColorIndex;ColorIndex;1;0;Create;True;0;0;0;False;0;False;0;0;False;0;1;INT;0
Node;AmplifyShaderEditor.AbsOpNode;18;-825.6699,185.173;Inherit;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;10;-828.0668,439.4967;Inherit;False;Property;_MinAlpha;MinAlpha;2;0;Create;True;0;0;0;False;0;False;0.5;-0.5;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;11;-826.647,510.8691;Inherit;False;Property;_MaxAlpha;MaxAlpha;3;1;[HDR];Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.TFHCIf;25;-756.352,-245.5659;Inherit;False;6;0;INT;0;False;1;INT;0;False;2;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;4;COLOR;0,0,0,0;False;5;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SmoothstepOpNode;31;-589.9502,154.2283;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;19;-106.3295,-5.02082;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.ClampOpNode;9;-494.7867,323.4244;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;161.1177,-41.91241;Half;False;True;-1;2;ASEMaterialInspector;100;1;AlphaHuXiBase;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;0;5;False;-1;10;False;-1;2;5;False;-1;10;False;-1;True;0;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;True;0;False;-1;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;True;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;1;RenderType=Transparent=RenderType;True;2;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=ForwardBase;False;0;Unlit/Color;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;1;True;False;;False;0
WireConnection;6;0;12;0
WireConnection;30;0;6;0
WireConnection;18;0;30;0
WireConnection;25;0;24;0
WireConnection;25;1;26;0
WireConnection;25;2;28;0
WireConnection;25;3;3;0
WireConnection;25;4;29;0
WireConnection;31;0;18;0
WireConnection;31;1;10;0
WireConnection;31;2;11;0
WireConnection;19;0;25;0
WireConnection;19;1;31;0
WireConnection;9;0;18;0
WireConnection;9;1;10;0
WireConnection;9;2;11;0
WireConnection;0;0;19;0
ASEEND*/
//CHKSM=D6F4293D858096613642169E78010F5919E039B8

@ -0,0 +1,222 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "AlphaHuXiCell"
{
Properties
{
[HDR]_TintColor("TintColor", Color) = (1,1,1,1)
_Speed("Speed", Range( 0 , 2)) = 1
_TexScale("TexScale", Range( 0 , 0.8)) = 0.66
_MinAlpha("MinAlpha", Range( 0 , 1)) = 0.5
_MaxAlpha("MaxAlpha", Range( 0 , 1)) = 1
_TilingScale("TilingScale", Range( 0 , 100)) = 8
}
SubShader
{
Tags { "RenderType"="Transparent" }
LOD 100
CGINCLUDE
#pragma target 3.0
ENDCG
Blend Off
AlphaToMask On
Cull Back
ColorMask RGBA
ZWrite On
ZTest LEqual
Offset 0 , 0
Pass
{
Name "Unlit"
Tags { "LightMode"="ForwardBase" }
CGPROGRAM
#ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
//only defining to not throw compilation error over Unity 5.5
#define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
#endif
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing
#include "UnityCG.cginc"
#include "UnityShaderVariables.cginc"
struct appdata
{
float4 vertex : POSITION;
float4 color : COLOR;
float4 ase_texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
float3 worldPos : TEXCOORD0;
#endif
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
uniform half _TilingScale;
uniform half _TexScale;
uniform half4 _TintColor;
uniform half _Speed;
uniform half _MinAlpha;
uniform half _MaxAlpha;
float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); }
float snoise( float2 v )
{
const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 );
float2 i = floor( v + dot( v, C.yy ) );
float2 x0 = v - i + dot( i, C.xx );
float2 i1;
i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 );
float4 x12 = x0.xyxy + C.xxzz;
x12.xy -= i1;
i = mod2D289( i );
float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) );
float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 );
m = m * m;
m = m * m;
float3 x = 2.0 * frac( p * C.www ) - 1.0;
float3 h = abs( x ) - 0.5;
float3 ox = floor( x + 0.5 );
float3 a0 = x - ox;
m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h );
float3 g;
g.x = a0.x * x0.x + h.x * x0.y;
g.yz = a0.yz * x12.xz + h.yz * x12.yw;
return 130.0 * dot( m, g );
}
v2f vert ( appdata v )
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
o.ase_texcoord1.xy = v.ase_texcoord.xy;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord1.zw = 0;
float3 vertexValue = float3(0, 0, 0);
#if ASE_ABSOLUTE_VERTEX_POS
vertexValue = v.vertex.xyz;
#endif
vertexValue = vertexValue;
#if ASE_ABSOLUTE_VERTEX_POS
v.vertex.xyz = vertexValue;
#else
v.vertex.xyz += vertexValue;
#endif
o.vertex = UnityObjectToClipPos(v.vertex);
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
#endif
return o;
}
fixed4 frag (v2f i ) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(i);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
fixed4 finalColor;
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
float3 WorldPosition = i.worldPos;
#endif
half2 break19_g4 = float2( -0.5,0.5 );
half2 temp_cast_0 = (_TilingScale).xx;
half temp_output_2_0_g2 = _TexScale;
half2 appendResult10_g3 = (half2(temp_output_2_0_g2 , temp_output_2_0_g2));
half2 temp_output_11_0_g3 = ( abs( (frac( (i.ase_texcoord1.xy*temp_cast_0 + ( 1.0 - abs( ( _Time.y * half2( 0,-1 ) ) ) )) )*2.0 + -1.0) ) - appendResult10_g3 );
half2 break16_g3 = ( 1.0 - ( temp_output_11_0_g3 / fwidth( temp_output_11_0_g3 ) ) );
half2 temp_cast_1 = (( 1.0 - saturate( min( break16_g3.x , break16_g3.y ) ) )).xx;
half simplePerlin2D21 = snoise( temp_cast_1 );
simplePerlin2D21 = simplePerlin2D21*0.5 + 0.5;
half temp_output_1_0_g4 = simplePerlin2D21;
half sinIn7_g4 = sin( temp_output_1_0_g4 );
half sinInOffset6_g4 = sin( ( temp_output_1_0_g4 + 1.0 ) );
half lerpResult20_g4 = lerp( break19_g4.x , break19_g4.y , frac( ( sin( ( ( sinIn7_g4 - sinInOffset6_g4 ) * 91.2228 ) ) * 43758.55 ) ));
half mulTime6 = _Time.y * _Speed;
half clampResult9 = clamp( abs( cos( mulTime6 ) ) , _MinAlpha , _MaxAlpha );
finalColor = ( ( ( lerpResult20_g4 + sinIn7_g4 ) * _TintColor ) * clampResult9 );
return finalColor;
}
ENDCG
}
}
CustomEditor "ASEMaterialInspector"
}
/*ASEBEGIN
Version=18900
138.4;211.2;1253;494;1355.249;-338.1642;1;True;True
Node;AmplifyShaderEditor.SimpleTimeNode;27;-3005.977,-196.8076;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.Vector2Node;34;-2778.366,44.00694;Inherit;False;Constant;_Vector0;Vector 0;2;0;Create;True;0;0;0;False;0;False;0,-1;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;35;-2487.168,-151.6911;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.AbsOpNode;36;-2216.82,-185.2358;Inherit;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.RangedFloatNode;29;-1686.195,-0.5533028;Inherit;False;Property;_TexScale;TexScale;2;0;Create;True;0;0;0;False;0;False;0.66;0.7;0;0.8;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;42;-1891.618,-318.0298;Inherit;False;Property;_TilingScale;TilingScale;5;0;Create;True;0;0;0;False;0;False;8;8;0;100;0;1;FLOAT;0
Node;AmplifyShaderEditor.OneMinusNode;40;-1933.35,-132.7194;Inherit;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.RangedFloatNode;12;-1606.371,420.7017;Inherit;False;Property;_Speed;Speed;1;0;Create;True;0;0;0;False;0;False;1;1;0;2;0;1;FLOAT;0
Node;AmplifyShaderEditor.FunctionNode;30;-1674.191,-280.1075;Inherit;False;Grid;-1;;2;a9240ca2be7e49e4f9fa3de380c0dbe9;0;3;5;FLOAT2;8,8;False;6;FLOAT2;0,0;False;2;FLOAT;0.9;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleTimeNode;6;-1248.593,353.9346;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.OneMinusNode;41;-1396.517,-214.0742;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.NoiseGeneratorNode;21;-1184.857,-309.1437;Inherit;False;Simplex2D;True;False;2;0;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.CosOpNode;17;-1021.766,421.278;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.ColorNode;3;-878.1637,-26.83372;Inherit;False;Property;_TintColor;TintColor;0;1;[HDR];Create;True;0;0;0;False;0;False;1,1,1,1;0.380073,0.4908573,0.6886792,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.AbsOpNode;18;-820.817,380.3366;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.FunctionNode;44;-915.8235,-319.9041;Inherit;False;Noise Sine Wave;-1;;4;a6eff29f739ced848846e3b648af87bd;0;2;1;FLOAT;0;False;2;FLOAT2;-0.5,0.5;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;10;-1043.214,521.6603;Inherit;False;Property;_MinAlpha;MinAlpha;3;0;Create;True;0;0;0;False;0;False;0.5;0.5;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;45;-828.2487,630.1642;Inherit;False;Property;_MaxAlpha;MaxAlpha;4;0;Create;True;0;0;0;False;0;False;1;0.5;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;2;-479.6482,-205.4569;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.ClampOpNode;9;-560.9338,396.588;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;43;-1273.093,-38.53386;Inherit;False;Constant;_Float3;Float 3;5;0;Create;True;0;0;0;False;0;False;-0.57;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;19;-163.4236,76.54218;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;161.1177,-41.91241;Half;False;True;-1;2;ASEMaterialInspector;100;1;AlphaHuXi;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;0;5;False;-1;10;False;-1;0;1;False;-1;0;False;-1;True;0;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;True;0;False;-1;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;1;RenderType=Transparent=RenderType;True;2;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=ForwardBase;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;1;True;False;;False;0
WireConnection;35;0;27;0
WireConnection;35;1;34;0
WireConnection;36;0;35;0
WireConnection;40;0;36;0
WireConnection;30;5;42;0
WireConnection;30;6;40;0
WireConnection;30;2;29;0
WireConnection;6;0;12;0
WireConnection;41;0;30;0
WireConnection;21;0;41;0
WireConnection;17;0;6;0
WireConnection;18;0;17;0
WireConnection;44;1;21;0
WireConnection;2;0;44;0
WireConnection;2;1;3;0
WireConnection;9;0;18;0
WireConnection;9;1;10;0
WireConnection;9;2;45;0
WireConnection;19;0;2;0
WireConnection;19;1;9;0
WireConnection;0;0;19;0
ASEEND*/
//CHKSM=293ED0BD96440BDC11C8F4EC98C98CC2008B8DA6

@ -0,0 +1,189 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Shiny"
{
Properties
{
[HDR]_MainTex("MainTex", 2D) = "white" {}
_Speed("Speed", Range( 0 , 2)) = 1
[HDR]_LightColor("LightColor", Color) = (0.9150943,0.9150943,0.9150943,0)
_Tint("Tint", Color) = (1,1,1,1)
[HideInInspector] _texcoord( "", 2D ) = "white" {}
}
SubShader
{
Tags { "RenderType"="TransparentCutout" }
LOD 100
CGINCLUDE
#pragma target 3.0
ENDCG
Blend Off
AlphaToMask On
Cull Back
ColorMask RGBA
ZWrite On
ZTest LEqual
Offset 0 , 0
Pass
{
Name "Unlit"
Tags { "LightMode"="ForwardBase" }
CGPROGRAM
#ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
//only defining to not throw compilation error over Unity 5.5
#define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
#endif
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing
#include "UnityCG.cginc"
#include "UnityShaderVariables.cginc"
struct appdata
{
float4 vertex : POSITION;
float4 color : COLOR;
float4 ase_texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
float3 worldPos : TEXCOORD0;
#endif
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
uniform sampler2D _MainTex;
uniform half4 _MainTex_ST;
uniform half4 _Tint;
uniform half _Speed;
uniform half4 _LightColor;
v2f vert ( appdata v )
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
o.ase_texcoord1.xy = v.ase_texcoord.xy;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord1.zw = 0;
float3 vertexValue = float3(0, 0, 0);
#if ASE_ABSOLUTE_VERTEX_POS
vertexValue = v.vertex.xyz;
#endif
vertexValue = vertexValue;
#if ASE_ABSOLUTE_VERTEX_POS
v.vertex.xyz = vertexValue;
#else
v.vertex.xyz += vertexValue;
#endif
o.vertex = UnityObjectToClipPos(v.vertex);
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
#endif
return o;
}
fixed4 frag (v2f i ) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(i);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
fixed4 finalColor;
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
float3 WorldPosition = i.worldPos;
#endif
float2 uv_MainTex = i.ase_texcoord1.xy * _MainTex_ST.xy + _MainTex_ST.zw;
half4 tex2DNode1 = tex2D( _MainTex, uv_MainTex );
half2 temp_cast_0 = (sin( ( _Time.y * _Speed ) )).xx;
half2 texCoord7 = i.ase_texcoord1.xy * float2( 1,1 ) + temp_cast_0;
float cos35 = cos( 0.75 );
float sin35 = sin( 0.75 );
half2 rotator35 = mul( texCoord7 - float2( 0,0 ) , float2x2( cos35 , -sin35 , sin35 , cos35 )) + float2( 0,0 );
half smoothstepResult17 = smoothstep( 0.3 , 0.92 , ( 1.0 - abs( (17.01 + (rotator35.x - 0.0) * (1.0 - 17.01) / (1.0 - 0.0)) ) ));
finalColor = ( ( tex2DNode1.a * _Tint ) + ( ( tex2DNode1.a * smoothstepResult17 ) * _LightColor ) );
return finalColor;
}
ENDCG
}
}
CustomEditor "ASEMaterialInspector"
Fallback "Standard"
}
/*ASEBEGIN
Version=18900
85.6;269.6;1253;451;2342.125;49.74371;1;True;True
Node;AmplifyShaderEditor.SimpleTimeNode;45;-2168.783,190.5474;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;40;-2229.09,294.8286;Inherit;False;Property;_Speed;Speed;1;0;Create;True;0;0;0;False;0;False;1;0.16;0;2;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;39;-1799.575,232.1646;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SinOpNode;37;-1742.518,132.2389;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;7;-1449.885,11.76552;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.RangedFloatNode;33;-1441.835,306.3659;Inherit;False;Constant;_Float1;Float 1;1;0;Create;True;0;0;0;False;0;False;0.75;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RotatorNode;35;-1168.527,-19.65416;Inherit;False;3;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;2;FLOAT;1;False;1;FLOAT2;0
Node;AmplifyShaderEditor.BreakToComponentsNode;25;-878.0097,-27.44243;Inherit;False;FLOAT2;1;0;FLOAT2;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.RangedFloatNode;10;-958.5267,364.785;Inherit;False;Constant;_Float0;Float 0;1;0;Create;True;0;0;0;False;0;False;17.01;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.TFHCRemapNode;9;-606.2599,94.17328;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;0;False;4;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.AbsOpNode;11;-198.4675,108.6946;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.OneMinusNode;14;70.54938,109.1388;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;18;153.9417,429.3619;Inherit;False;Constant;_Float2;Float 2;1;0;Create;True;0;0;0;False;0;False;0.92;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;19;122.1936,292.041;Inherit;False;Constant;_Float3;Float 3;1;0;Create;True;0;0;0;False;0;False;0.3;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SmoothstepOpNode;17;391.4089,94.94611;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;1;317.2291,-208.6719;Inherit;True;Property;_MainTex;MainTex;0;1;[HDR];Create;True;0;0;0;False;0;False;-1;None;b6ca66d1c17b2314986797ad948ba4c6;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.ColorNode;42;715.9771,410.0996;Inherit;False;Property;_LightColor;LightColor;2;1;[HDR];Create;True;0;0;0;False;0;False;0.9150943,0.9150943,0.9150943,0;2.259126,2.253818,1.017198,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;30;677.2454,134.4901;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.ColorNode;44;681.0007,-67.09228;Inherit;False;Property;_Tint;Tint;3;0;Create;True;0;0;0;False;0;False;1,1,1,1;0.5546013,0.8799367,0.9716981,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;41;943.4365,166.4395;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;43;922.2367,-207.0605;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleAddOpNode;29;1106.683,-56.42291;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.Vector2Node;28;-1250.489,223.0777;Inherit;False;Constant;_Vector0;Vector 0;1;0;Create;True;0;0;0;False;0;False;0.38,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;1442.191,-63.73458;Half;False;True;-1;2;ASEMaterialInspector;100;1;Shiny;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;False;True;0;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;True;0;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;True;0;False;-1;True;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;1;RenderType=TransparentCutout=RenderType;True;2;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=ForwardBase;False;0;Standard;3;=;=;=;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;1;True;False;;False;0
WireConnection;39;0;45;0
WireConnection;39;1;40;0
WireConnection;37;0;39;0
WireConnection;7;1;37;0
WireConnection;35;0;7;0
WireConnection;35;2;33;0
WireConnection;25;0;35;0
WireConnection;9;0;25;0
WireConnection;9;3;10;0
WireConnection;11;0;9;0
WireConnection;14;0;11;0
WireConnection;17;0;14;0
WireConnection;17;1;19;0
WireConnection;17;2;18;0
WireConnection;30;0;1;4
WireConnection;30;1;17;0
WireConnection;41;0;30;0
WireConnection;41;1;42;0
WireConnection;43;0;1;4
WireConnection;43;1;44;0
WireConnection;29;0;43;0
WireConnection;29;1;41;0
WireConnection;0;0;29;0
ASEEND*/
//CHKSM=B808992311A7BF28BD2A92302E68B918108B6990

@ -4,8 +4,9 @@
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: day
m_Shader: {fileID: 104, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
@ -39,7 +40,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DownTex:
m_Texture: {fileID: 2800000, guid: 80839f561350d7e4fb4695cb556bd296, type: 3}
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:

@ -38,11 +38,11 @@ Material:
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Scale: {x: 1.3, y: 1.95}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 322450cfcad417544aeae9a5ec161f8b, type: 3}
m_Scale: {x: 1, y: 1}
m_Scale: {x: 1.3, y: 1.95}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
@ -64,7 +64,7 @@ Material:
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Metallic: 0.164
- _Mode: 2
- _OcclusionStrength: 1
- _Parallax: 0.02

File diff suppressed because it is too large Load Diff

@ -15,7 +15,7 @@ public static class Const
//刷车最小/最大时间
public static int RefreshCarminTime = 1;
public static int RefreshCarmaxTime = 10;
public static int RefreshCarmaxTime = 2;

@ -44,7 +44,7 @@ public class GameRoot : MonoBehaviour
{
// pt.Update();
roadSys.RoadStateUpdate(3);//每n秒检测路段状态
roadSys.RoadStateUpdate(1.5f);//每n秒检测路段状态
infoWnd.UpdateTime();
}

@ -38,8 +38,8 @@ public class CarSys : MonoBehaviour
}
#region CarAI
//检索移动
#region 车辆AI
//检索汽车生成
public void CheckBornoint()
{
GameObject[] bornPoints = GameObject.FindGameObjectsWithTag("BornPoint");
@ -50,7 +50,7 @@ public class CarSys : MonoBehaviour
}
}
//检索移动
//检索移动列表
public void CheckMovePoint()
{
GameObject[] moveObjs = GameObject.FindGameObjectsWithTag("MoveList");
@ -91,7 +91,7 @@ public class CarSys : MonoBehaviour
yield return new WaitForSeconds(0.02f);
drive.drivetime += Time.deltaTime;
//前方车辆安全距离检测
if (drive.drivetime > Const.SafeCheckTime)
if (drive.drivetime >= drive.checktime)
{
drive.isnormalDrive = CheckFrontCar(drive) ? false : true;
@ -136,7 +136,8 @@ public class CarSys : MonoBehaviour
//回收车辆
carList.Remove(drive.carId);
Destroy(agent.gameObject);
GameRoot.Instance.infoWnd.SetCarText(-1);
GameRoot.Instance.infoWnd.SetCarOutText(1);
}
}
@ -187,36 +188,11 @@ public class CarSys : MonoBehaviour
#region 汽车随机生成
public void CreatCar(Transform parent)
{
// 随机创建车辆种类
int carIndex = Random.Range(0, carTypeList.Length - 1);
//实例化车辆
GameObject car = GameObject.Instantiate(carTypeList[carIndex], parent.position, Quaternion.identity, parent);
car.transform.localEulerAngles = parent.localEulerAngles;
//car驾驶类赋值
Drive drive = car.GetComponent<Drive>();
drive.carId = CarID;
carList.Add(CarID, drive.gameObject);
CarID++;
if (drive.carId != 0)
{
GameObject go = null;
carList.TryGetValue(drive.carId - 1, out go);
drive.FrontCar = go;
}
//统计数量更新
GameRoot.Instance.infoWnd.SetCarText(1);//+1
//执行寻路AI
NavMeshAgent agent = car.GetComponent<NavMeshAgent>();
if (agent != null)
{
StartCoroutine(CarMove(parent.name, agent));
}
}
/// <summary>
/// 生成汽车递归携程在GameRoot中启用一次即可
/// </summary>
/// <returns></returns>
public IEnumerator RandomTimeCreat()
{
//随机获取出生点
@ -227,10 +203,11 @@ public class CarSys : MonoBehaviour
{
//随机时间
int t = Random.Range(Const.RefreshCarminTime, Const.RefreshCarmaxTime);
Debug.Log(t);
while (true)
{
yield return new WaitForEndOfFrame();
yield return new WaitForSeconds(Time.deltaTime);
timer += Time.deltaTime;
if (timer >= t)
@ -241,13 +218,48 @@ public class CarSys : MonoBehaviour
}
CreatCar(parent);
float checkTime = t / 5;
CreatCar(parent,checkTime);
}
StartCoroutine(RandomTimeCreat());
}
/// <summary>
/// 汽车生成函数
/// </summary>
/// <param name="parent">生成之后的父物体</param>
/// <param name="checktime">生成后开始行驶检测的时间</param>
public void CreatCar(Transform parent,float checktime)
{
// 随机创建车辆种类
int carIndex = Random.Range(0, carTypeList.Length - 1);
//实例化车辆
GameObject car = GameObject.Instantiate(carTypeList[carIndex], parent.position, Quaternion.identity, parent);
car.transform.localEulerAngles = parent.localEulerAngles;
//car驾驶类赋值
Drive drive = car.GetComponent<Drive>();
drive.carId = CarID;
drive.checktime = checktime;
carList.Add(CarID, drive.gameObject);
CarID++;
if (drive.carId != 0)
{
GameObject go = null;
carList.TryGetValue(drive.carId - 1, out go);
drive.FrontCar = go;
}
//统计数量更新
GameRoot.Instance.infoWnd.SetCarInText(1);//+1
//执行寻路AI
NavMeshAgent agent = car.GetComponent<NavMeshAgent>();
if (agent != null)
{
StartCoroutine(CarMove(parent.name, agent));
}
}
#endregion

@ -77,18 +77,19 @@ public class RoadSys : MonoBehaviour
if(roadStateDict.TryGetValue(item.Key, out state_object))
{
int numble = item.Value;//监控的车辆数量
MeshRenderer renderer = state_object.GetComponent<MeshRenderer>();
if (numble >= 0 && numble <= 5)//绿色状态
if (numble >= 0 && numble <= 4)//绿色状态
{
state_object.GetComponent<MeshRenderer>().material.color = Color.green;
renderer.material.SetInt("_ColorIndex",0);
}
else if(numble > 5 && numble <= 10)//黄色状态
else if(numble > 4 && numble <= 8)//黄色状态
{
state_object.GetComponent<MeshRenderer>().material.color = Color.yellow;
renderer.material.SetInt("_ColorIndex", 1);
}
else if (numble > 10 )//红色拥堵
else if (numble > 8 )//红色拥堵
{
state_object.GetComponent<MeshRenderer>().material.color = Color.red;
renderer.material.SetInt("_ColorIndex", 2);
}
}

@ -12,8 +12,9 @@ public class Drive : MonoBehaviour
public bool isnormalDrive = true;
public DriveState dirveState = DriveState.Line;
[HideInInspector]
public float drivetime = 0f;
public float drivetime = 0;
public float checktime = 0;
public int carId = 0;

@ -1,47 +0,0 @@
/****************************************************
EntityBase.cs
Plane
: 1785275942@qq.com
2019/03/19 6:40
*****************************************************/
using System.Collections.Generic;
using UnityEngine;
public abstract class EntityBase {
public AniState currentAniState = AniState.None;
public StateMgr stateMgr = null;
private string name;
public string Name {
get {
return name;
}
set {
name = value;
}
}
public void Move() {
stateMgr.ChangeStatus(this, AniState.Move, null);
}
}

@ -1,25 +0,0 @@
/****************************************************
IState.cs
Plane
: 1785275942@qq.com
2019/03/19 6:38
*****************************************************/
public interface IState {
void Enter(EntityBase entity, params object[] args);//可变参数
void Process(EntityBase entity, params object[] args);
void Exit(EntityBase entity, params object[] args);
}
public enum AniState {
None,
Born,
Idle,
Move,
Attack,
Hit,
Die
}

@ -1,21 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MoveState : IState
{
public void Enter(EntityBase entity, params object[] args)
{
throw new System.NotImplementedException();
}
public void Exit(EntityBase entity, params object[] args)
{
throw new System.NotImplementedException();
}
public void Process(EntityBase entity, params object[] args)
{
throw new System.NotImplementedException();
}
}

@ -1,36 +0,0 @@
/****************************************************
StateMgr.cs
Plane
: 1785275942@qq.com
2019/03/15 9:08
*****************************************************/
using UnityEngine;
using System.Collections.Generic;
public class StateMgr : MonoBehaviour {
private Dictionary<AniState, IState> fsm = new Dictionary<AniState, IState>();
public void Init() {
//fsm.Add(AniState.Born, new StateBorn());
}
public void ChangeStatus(EntityBase entity, AniState targetState, params object[] args) {
if (entity.currentAniState == targetState) {
return;
}
if (fsm.ContainsKey(targetState)) {
if (entity.currentAniState != AniState.None) {
fsm[entity.currentAniState].Exit(entity, args);
}
fsm[targetState].Enter(entity, args);
fsm[targetState].Process(entity, args);
}
}
}

@ -461,7 +461,7 @@ public class PETimer {
return (int)GetLocalDateTime().DayOfWeek;
}
public DateTime GetLocalDateTime() {
DateTime dt = TimeZone.CurrentTimeZone.ToLocalTime(startDateTime.AddMilliseconds(nowTime));
DateTime dt=DateTime.Now;
return dt;
}
public double GetMillisecondsTime() {

@ -6,8 +6,9 @@ using UnityEngine.UI;
public class InfoWnd : MonoBehaviour
{
public Text carTxt;
public Text humanTxt;
public Text carInTxt;
public Text carOutTxt;
public Text carAllTxt;
public Text dateTxt;
public string date;
@ -17,18 +18,25 @@ public class InfoWnd : MonoBehaviour
}
public void SetCarText(int Addvalue)
public void SetCarInText(int Addvalue)
{
int n = int.Parse(carTxt.text) + Addvalue;
carTxt.text = n.ToString();
int n = int.Parse(carInTxt.text) + Addvalue;
carInTxt.text = n.ToString();
int n1 = int.Parse(carAllTxt.text) + Addvalue;
carAllTxt.text = n1.ToString();
}
public void SetHumanText(int Addvalue)
public void SetCarOutText(int Addvalue)
{
int n = int.Parse(humanTxt.text) + Addvalue;
humanTxt.text = n.ToString();
int n = int.Parse(carOutTxt.text) + Addvalue;
carOutTxt.text = n.ToString();
int n1 = int.Parse(carAllTxt.text) + Addvalue;
carAllTxt.text = n1.ToString();
}
public void UpdateTime()
@ -39,7 +47,7 @@ public class InfoWnd : MonoBehaviour
var year = DateTime.Now.Year;
var month = DateTime.Now.Month;
var day = DateTime.Now.Day;
date = string.Format( "{0:D4}/{1:D2}/{2:D2}"+" "+"{3:D2}:{4:D2}:{5:D2} " , year, month, day,hour, minute, second);
date = string.Format( "{0:D4}/{1:D2}/{2:D2}"+"-"+"{3:D2}:{4:D2}:{5:D2} " , year, month, day,hour, minute, second);
dateTxt.text = date;
}
}

@ -37,13 +37,13 @@ public class MenuWnd : MonoBehaviour
switch (viewIndex)
{
case 0:
twoDcamera.SetActive(false);
threeDcamera.SetActive(true);
break;
case 1:
twoDcamera.SetActive(true);
threeDcamera.SetActive(false);
break;
case 1:
twoDcamera.SetActive(false);
threeDcamera.SetActive(true);
break;
}
}
}

Binary file not shown.

@ -4,5 +4,8 @@
EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes: []
m_Scenes:
- enabled: 1
path: Assets/Scenes/City.unity
guid: fe5db4214fd5c79479310141bccac16e
m_configObjects: {}

@ -583,7 +583,7 @@ PlayerSettings:
webGLThreadsSupport: 0
webGLWasmStreaming: 0
scriptingDefineSymbols:
1: UNITY_POST_PROCESSING_STACK_V2
1: UNITY_POST_PROCESSING_STACK_V2;AMPLIFY_SHADER_EDITOR
4: UNITY_POST_PROCESSING_STACK_V2
7: UNITY_POST_PROCESSING_STACK_V2
13: UNITY_POST_PROCESSING_STACK_V2

Loading…
Cancel
Save