网站建设推广服务合同范本,开源社区源码,从音乐网站下载歌曲做铃音要收费吗,深圳外贸平台建站本组件仅实现A传送点到B传送的功能#xff0c;是可以双向传送的#xff0c;如果只要单向传送#xff0c;可以另外改脚本实现#xff1b;
先看效果#xff1a; unity组件传送点演示 1.传送组件shader是怎么写的#xff1a;这种效果的实现方案 shader编辑器是这样的#… 本组件仅实现A传送点到B传送的功能是可以双向传送的如果只要单向传送可以另外改脚本实现
先看效果 unity组件传送点演示 1.传送组件shader是怎么写的这种效果的实现方案 shader编辑器是这样的 代码是这样的
// Made with Amplify Shader Editor v1.9.1.5
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader INS/ChuangDian_CZ
{Properties{_Color(Color, Color) (1,1,1,0)_Texture(Texture, 2D) white {}_Desaturate(Desaturate, Range( 0 , 1)) 0.5_RuoHua(RuoHua, Range( 0 , 1)) 1_Metallic(Metallic, Range( 0 , 1)) 0_Smoothness(Smoothness, Range( 0 , 1)) 0[HideInInspector] _texcoord( , 2D ) white {}[HideInInspector] __dirty( , Int ) 1}SubShader{Tags{ RenderType Opaque Queue Geometry0 }Cull BackCGPROGRAM#pragma target 3.0#pragma surface surf Standard keepalpha addshadow fullforwardshadows struct Input{float2 uv_texcoord;};uniform sampler2D _Texture;uniform float4 _Texture_ST;uniform float _Desaturate;uniform float4 _Color;uniform float _RuoHua;uniform float _Metallic;uniform float _Smoothness;void surf( Input i , inout SurfaceOutputStandard o ){float2 uv_Texture i.uv_texcoord * _Texture_ST.xy _Texture_ST.zw;float3 desaturateInitialColor9 tex2D( _Texture, uv_Texture ).rgb;float desaturateDot9 dot( desaturateInitialColor9, float3( 0.299, 0.587, 0.114 ));float3 desaturateVar9 lerp( desaturateInitialColor9, desaturateDot9.xxx, _Desaturate );float4 lerpResult15 lerp( ( float4( desaturateVar9 , 0.0 ) * _Color ) , _Color , _RuoHua);o.Albedo lerpResult15.rgb;o.Metallic _Metallic;o.Smoothness _Smoothness;o.Alpha 1;}ENDCG}Fallback DiffuseCustomEditor ASEMaterialInspector
}
/*ASEBEGIN
Version19105
Node;AmplifyShaderEditor.DesaturateOpNode;9;-717.8729,-223.8029;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.RangedFloatNode;4;-360.5876,42.01204;Inherit;False;Property;_Metallic;Metallic;4;0;Create;True;0;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;5;-360.6326,117.4722;Inherit;False;Property;_Smoothness;Smoothness;5;0;Create;True;0;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;66.00646,4.950484;Float;False;True;-1;2;ASEMaterialInspector;0;0;Standard;INS/ChuangDian_CZ;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;Back;0;False;;0;False;;False;0;False;;0;False;;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;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;True;0;0;False;;0;False;;0;0;False;;0;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;5;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;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;6;-475.0052,-181.1613;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.ColorNode;3;-743.4476,-96.76402;Inherit;False;Property;_Color;Color;0;0;Create;True;0;0;0;False;0;False;1,1,1,0;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;8;-1069,-200.3001;Inherit;False;Property;_Desaturate;Desaturate;2;0;Create;True;0;0;0;False;0;False;0.5;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.LerpOp;15;-198.6593,-181.8569;Inherit;True;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.RangedFloatNode;16;-494.9561,-46.60926;Inherit;False;Property;_RuoHua;RuoHua;3;0;Create;True;0;0;0;False;0;False;1;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;2;-1135.341,-462.8333;Inherit;True;Property;_Texture;Texture;1;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
WireConnection;9;0;2;0
WireConnection;9;1;8;0
WireConnection;0;0;15;0
WireConnection;0;3;4;0
WireConnection;0;4;5;0
WireConnection;6;0;9;0
WireConnection;6;1;3;0
WireConnection;15;0;6;0
WireConnection;15;1;3;0
WireConnection;15;2;16;0
ASEEND*/
//CHKSM58E752AB348EAA75CF5226F291024A24776642B6
2.实现传送功能需要的节点和脚本poinA和pointB 对应子节点中的两个sphere 3.传送过程中的效果表现shader怎么写也就是Dissolve材质球 代码是这样的
// Made with Amplify Shader Editor v1.9.1.5
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader Dissolve
{Properties{_Albedo(Albedo, 2D) white {}_Normal(Normal, 2D) white {}_MetalAOSmooth(MetalAOSmooth, 2D) white {}_DissolveAmount(DissolveAmount, Float) 0_EmissColor(EmissColor, Color) (0,0,0,0)_EmissIntensity(EmissIntensity, Float) 0_DissolveRange(DissolveRange, Float) 0_NoiseTex(NoiseTex, 2D) white {}_T_Noise_dissolve(T_Noise_dissolve, 2D) white {}[HideInInspector] _texcoord( , 2D ) white {}[HideInInspector] __dirty( , Int ) 1}SubShader{Tags{ RenderType Transparent Queue Transparent0 IgnoreProjector True IsEmissive true }Cull BackCGINCLUDE#include UnityShaderVariables.cginc#include UnityPBSLighting.cginc#include Lighting.cginc#pragma target 3.0#ifdef UNITY_PASS_SHADOWCASTER#undef INTERNAL_DATA#undef WorldReflectionVector#undef WorldNormalVector#define INTERNAL_DATA half3 internalSurfaceTtoW0; half3 internalSurfaceTtoW1; half3 internalSurfaceTtoW2;#define WorldReflectionVector(data,normal) reflect (data.worldRefl, half3(dot(data.internalSurfaceTtoW0,normal), dot(data.internalSurfaceTtoW1,normal), dot(data.internalSurfaceTtoW2,normal)))#define WorldNormalVector(data,normal) half3(dot(data.internalSurfaceTtoW0,normal), dot(data.internalSurfaceTtoW1,normal), dot(data.internalSurfaceTtoW2,normal))#endifstruct Input{float3 worldPos;float2 uv_texcoord;float3 worldNormal;INTERNAL_DATA};uniform sampler2D _NoiseTex;uniform float4 _NoiseTex_ST;uniform float _DissolveAmount;uniform sampler2D _Normal;uniform float4 _Normal_ST;uniform sampler2D _Albedo;uniform float4 _Albedo_ST;uniform float4 _EmissColor;uniform sampler2D _T_Noise_dissolve;uniform float _EmissIntensity;uniform sampler2D _MetalAOSmooth;uniform float4 _MetalAOSmooth_ST;uniform float _DissolveRange;void vertexDataFunc( inout appdata_full v, out Input o ){UNITY_INITIALIZE_OUTPUT( Input, o );float3 ase_worldPos mul( unity_ObjectToWorld, v.vertex );float3 worldToObj1 mul( unity_WorldToObject, float4( ase_worldPos, 1 ) ).xyz;float2 uv_NoiseTex v.texcoord * _NoiseTex_ST.xy _NoiseTex_ST.zw;float temp_output_35_0 pow( tex2Dlod( _NoiseTex, float4( uv_NoiseTex, 0, 0.0) ).r , 2.0 );float temp_output_11_0 abs( 0.25 );float temp_output_9_0 ( -( worldToObj1.y temp_output_35_0 ) - temp_output_11_0 );float temp_output_8_0 ( -( worldToObj1.y temp_output_35_0 ) temp_output_11_0 );float smoothstepResult3 smoothstep( temp_output_9_0 , temp_output_8_0 , _DissolveAmount);v.vertex.xyz ( ( smoothstepResult3 * float3(0,5,0) ) worldToObj1 );v.vertex.w 1;}void surf( Input i , inout SurfaceOutputStandard o ){float2 uv_Normal i.uv_texcoord * _Normal_ST.xy _Normal_ST.zw;o.Normal UnpackNormal( tex2D( _Normal, uv_Normal ) );float2 uv_Albedo i.uv_texcoord * _Albedo_ST.xy _Albedo_ST.zw;o.Albedo tex2D( _Albedo, uv_Albedo ).rgb;float3 ase_worldNormal WorldNormalVector( i, float3( 0, 0, 1 ) );float3 ase_vertexNormal mul( unity_WorldToObject, float4( ase_worldNormal, 0 ) );ase_vertexNormal normalize( ase_vertexNormal );float3 objToView22 mul( UNITY_MATRIX_MV, float4( ase_vertexNormal, 1 ) ).xyz;float mulTime25 _Time.y * -0.02;float2 appendResult26 (float2(0.0 , mulTime25));float4 tex2DNode17 tex2D( _T_Noise_dissolve, ( ( objToView22 * float3( 0.13,0.3,0 ) ) float3( appendResult26 , 0.0 ) ).xy );float3 ase_worldPos i.worldPos;float3 worldToObj1 mul( unity_WorldToObject, float4( ase_worldPos, 1 ) ).xyz;float2 uv_NoiseTex i.uv_texcoord * _NoiseTex_ST.xy _NoiseTex_ST.zw;float temp_output_35_0 pow( tex2D( _NoiseTex, uv_NoiseTex ).r , 2.0 );float temp_output_11_0 abs( 0.25 );float temp_output_9_0 ( -( worldToObj1.y temp_output_35_0 ) - temp_output_11_0 );float temp_output_8_0 ( -( worldToObj1.y temp_output_35_0 ) temp_output_11_0 );float smoothstepResult3 smoothstep( temp_output_9_0 , temp_output_8_0 , _DissolveAmount);o.Emission ( ( ( ( _EmissColor * tex2DNode17 ) _EmissColor ) * _EmissIntensity ) * smoothstepResult3 ).rgb;float2 uv_MetalAOSmooth i.uv_texcoord * _MetalAOSmooth_ST.xy _MetalAOSmooth_ST.zw;float4 tex2DNode48 tex2D( _MetalAOSmooth, uv_MetalAOSmooth );o.Metallic tex2DNode48.r;o.Smoothness tex2DNode48.a;o.Occlusion tex2DNode48.g;float smoothstepResult32 smoothstep( temp_output_9_0 , temp_output_8_0 , ( _DissolveAmount - ( _DissolveRange * ( 1.0 - temp_output_35_0 ) ) ));o.Alpha saturate( ( ( 1.0 - smoothstepResult3 ) ( ( 1.0 - smoothstepResult32 ) * tex2DNode17.r ) ) );}ENDCGCGPROGRAM#pragma surface surf Standard alpha:fade keepalpha fullforwardshadows vertex:vertexDataFunc ENDCGPass{Name ShadowCasterTags{ LightMode ShadowCaster }ZWrite OnCGPROGRAM#pragma vertex vert#pragma fragment frag#pragma target 3.0#pragma multi_compile_shadowcaster#pragma multi_compile UNITY_PASS_SHADOWCASTER#pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2#include HLSLSupport.cginc#if ( SHADER_API_D3D11 || SHADER_API_GLCORE || SHADER_API_GLES || SHADER_API_GLES3 || SHADER_API_METAL || SHADER_API_VULKAN )#define CAN_SKIP_VPOS#endif#include UnityCG.cginc#include Lighting.cginc#include UnityPBSLighting.cgincsampler3D _DitherMaskLOD;struct v2f{V2F_SHADOW_CASTER;float2 customPack1 : TEXCOORD1;float4 tSpace0 : TEXCOORD2;float4 tSpace1 : TEXCOORD3;float4 tSpace2 : TEXCOORD4;UNITY_VERTEX_INPUT_INSTANCE_IDUNITY_VERTEX_OUTPUT_STEREO};v2f vert( appdata_full v ){v2f o;UNITY_SETUP_INSTANCE_ID( v );UNITY_INITIALIZE_OUTPUT( v2f, o );UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );UNITY_TRANSFER_INSTANCE_ID( v, o );Input customInputData;vertexDataFunc( v, customInputData );float3 worldPos mul( unity_ObjectToWorld, v.vertex ).xyz;half3 worldNormal UnityObjectToWorldNormal( v.normal );half3 worldTangent UnityObjectToWorldDir( v.tangent.xyz );half tangentSign v.tangent.w * unity_WorldTransformParams.w;half3 worldBinormal cross( worldNormal, worldTangent ) * tangentSign;o.tSpace0 float4( worldTangent.x, worldBinormal.x, worldNormal.x, worldPos.x );o.tSpace1 float4( worldTangent.y, worldBinormal.y, worldNormal.y, worldPos.y );o.tSpace2 float4( worldTangent.z, worldBinormal.z, worldNormal.z, worldPos.z );o.customPack1.xy customInputData.uv_texcoord;o.customPack1.xy v.texcoord;TRANSFER_SHADOW_CASTER_NORMALOFFSET( o )return o;}half4 frag( v2f IN#if !defined( CAN_SKIP_VPOS ), UNITY_VPOS_TYPE vpos : VPOS#endif) : SV_Target{UNITY_SETUP_INSTANCE_ID( IN );Input surfIN;UNITY_INITIALIZE_OUTPUT( Input, surfIN );surfIN.uv_texcoord IN.customPack1.xy;float3 worldPos float3( IN.tSpace0.w, IN.tSpace1.w, IN.tSpace2.w );half3 worldViewDir normalize( UnityWorldSpaceViewDir( worldPos ) );surfIN.worldPos worldPos;surfIN.worldNormal float3( IN.tSpace0.z, IN.tSpace1.z, IN.tSpace2.z );surfIN.internalSurfaceTtoW0 IN.tSpace0.xyz;surfIN.internalSurfaceTtoW1 IN.tSpace1.xyz;surfIN.internalSurfaceTtoW2 IN.tSpace2.xyz;SurfaceOutputStandard o;UNITY_INITIALIZE_OUTPUT( SurfaceOutputStandard, o )surf( surfIN, o );#if defined( CAN_SKIP_VPOS )float2 vpos IN.pos;#endifhalf alphaRef tex3D( _DitherMaskLOD, float3( vpos.xy * 0.25, o.Alpha * 0.9375 ) ).a;clip( alphaRef - 0.01 );SHADOW_CASTER_FRAGMENT( IN )}ENDCG}}Fallback DiffuseCustomEditor ASEMaterialInspector
}
/*ASEBEGIN
Version19105
Node;AmplifyShaderEditor.WorldPosInputsNode;2;-719.8619,7.13725;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.NegateNode;5;-144.2999,34.52414;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;7;-261.0644,-14.90448;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.AbsOpNode;11;19.19641,135.7086;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;27;1218.962,-409.4442;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleAddOpNode;28;1401.362,-355.0442;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleAddOpNode;23;817.2692,-805.6909;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT2;0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.SimpleSubtractOpNode;9;172.3755,-95.52279;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;8;188.786,27.72242;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;29;1548.792,-398.8269;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.RangedFloatNode;30;1408.792,-531.8269;Inherit;False;Property;_EmissIntensity;EmissIntensity;5;0;Create;True;0;0;0;False;0;False;0;3.65;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SmoothstepOpNode;3;514.8207,-251.9341;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;13;902.1608,175.2412;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.TransformPositionNode;1;-531.0639,-25.44292;Inherit;False;World;Object;False;Fast;True;1;0;FLOAT3;0,0,0;False;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.PowerNode;35;-316.6454,222.5346;Inherit;False;False;2;0;FLOAT;0;False;1;FLOAT;2;False;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;6;-731.2645,233.5954;Inherit;True;Property;_NoiseTex;NoiseTex;7;0;Create;True;0;0;0;False;0;False;-1;None;f8c46e1c2a15265408e41fa92886549b;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.RangedFloatNode;10;-142.8036,145.7086;Inherit;False;Constant;_smooth;smooth;2;0;Create;True;0;0;0;False;0;False;0.25;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.Vector3Node;12;644.4524,173.591;Inherit;False;Constant;_Vector0;Vector 0;3;0;Create;True;0;0;0;False;0;False;0,5,0;0,0,0;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.SimpleAddOpNode;14;1220.6,88.76579;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.SimpleSubtractOpNode;33;1055.637,-161.5284;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;36;969.3151,6.091968;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.OneMinusNode;37;337.4388,220.0167;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;34;659.8098,-33.82647;Inherit;False;Property;_DissolveRange;DissolveRange;6;0;Create;True;0;0;0;False;0;False;0;3.37;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;38;1929.468,-65.26013;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SmoothstepOpNode;32;1450.942,-63.80793;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.OneMinusNode;40;1801.102,-180.9123;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;16;1819.44,-304.5616;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.ColorNode;15;730.3444,-407.8557;Inherit;False;Property;_EmissColor;EmissColor;4;0;Create;True;0;0;0;False;0;False;0,0,0,0;0.2783018,0.6858239,1,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;20;672.7254,-807.2241;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0.13,0.3,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.NormalVertexDataNode;21;-48.33521,-877.1525;Inherit;False;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.TransformPositionNode;22;255.8536,-889.2006;Inherit;False;Object;View;False;Fast;True;1;0;FLOAT3;0,0,0;False;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.DynamicAppendNode;26;603.0665,-637.7112;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SamplerNode;17;936.7515,-680.4985;Inherit;True;Property;_T_Noise_dissolve;T_Noise_dissolve;8;0;Create;True;0;0;0;False;0;False;-1;0cf9ad0ec82276849a36a6400e35dd4e;0cf9ad0ec82276849a36a6400e35dd4e;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.SimpleTimeNode;25;373.3573,-618.2069;Inherit;False;1;0;FLOAT;-0.02;False;1;FLOAT;0
Node;AmplifyShaderEditor.OneMinusNode;31;1683.635,-36.73546;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SaturateNode;42;2179.549,-187.5133;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;39;2053.697,-145.9254;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;2844.106,-314.8162;Float;False;True;-1;2;ASEMaterialInspector;0;0;Standard;Dissolve;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;False;False;False;Back;1;False;;0;False;;False;0;False;;0;False;;False;0;Transparent;0.5;True;True;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;True;2;5;False;;10;False;;0;0;False;;0;False;;0;False;;0;False;;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;True;Absolute;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;5;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;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
Node;AmplifyShaderEditor.SamplerNode;48;2070.829,-502.1674;Inherit;True;Property;_MetalAOSmooth;MetalAOSmooth;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.SamplerNode;47;2349.744,-729.7792;Inherit;True;Property;_Normal;Normal;1;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;True;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;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;4;157.7782,-263.7874;Inherit;False;Property;_DissolveAmount;DissolveAmount;3;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;45;2357.703,-935.7942;Inherit;True;Property;_Albedo;Albedo;0;0;Create;False;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
WireConnection;5;0;7;0
WireConnection;7;0;1;2
WireConnection;7;1;35;0
WireConnection;11;0;10;0
WireConnection;27;0;15;0
WireConnection;27;1;17;0
WireConnection;28;0;27;0
WireConnection;28;1;15;0
WireConnection;23;0;20;0
WireConnection;23;1;26;0
WireConnection;9;0;5;0
WireConnection;9;1;11;0
WireConnection;8;0;5;0
WireConnection;8;1;11;0
WireConnection;29;0;28;0
WireConnection;29;1;30;0
WireConnection;3;0;4;0
WireConnection;3;1;9;0
WireConnection;3;2;8;0
WireConnection;13;0;3;0
WireConnection;13;1;12;0
WireConnection;1;0;2;0
WireConnection;35;0;6;1
WireConnection;14;0;13;0
WireConnection;14;1;1;0
WireConnection;33;0;4;0
WireConnection;33;1;36;0
WireConnection;36;0;34;0
WireConnection;36;1;37;0
WireConnection;37;0;35;0
WireConnection;38;0;31;0
WireConnection;38;1;17;1
WireConnection;32;0;33;0
WireConnection;32;1;9;0
WireConnection;32;2;8;0
WireConnection;40;0;3;0
WireConnection;16;0;29;0
WireConnection;16;1;3;0
WireConnection;20;0;22;0
WireConnection;22;0;21;0
WireConnection;26;1;25;0
WireConnection;17;1;23;0
WireConnection;31;0;32;0
WireConnection;42;0;39;0
WireConnection;39;0;40;0
WireConnection;39;1;38;0
WireConnection;0;0;45;0
WireConnection;0;1;47;0
WireConnection;0;2;16;0
WireConnection;0;3;48;1
WireConnection;0;4;48;4
WireConnection;0;5;48;2
WireConnection;0;9;42;0
WireConnection;0;11;14;0
ASEEND*/
//CHKSM598FD4007CD3F6F672F5FCA5BC8282E86A7E4D50
需要两张资源图片 4.好了一切准备就绪就进入传送的逻辑代码
using DG.Tweening;
using System;
using System.Collections;
using TMPro;
using UnityEngine;public class TranslationCom : MonoBehaviour {public Transform pointA;public Transform pointB;private bool canTeleport true;private float teleportDistance 1f;private Sequence sequence;public Material material;private GameObject cloneAvatar;private bool isTeleporting false;void Start () {//HudPanel.Instance.ShowText(pointA.gameObject,进入传送阵,new Vector3(0,1f,0));//HudPanel.Instance.ShowText(pointB.gameObject,进入传送阵,new Vector3(0,1f,0));}void DoTranslation(Vector3 targetPosition) {//PlayerController.Instance.transform.position targetPosition;StartCoroutine(waitShowTranslation(targetPosition));}IEnumerator waitShowTranslation(Vector3 targetPosition) {float duration 0.5f;cloneAvatar GameObject.Instantiate(PlayerController.Instance.animator.gameObject, PlayerController.Instance.transform);cloneAvatar.transform.localPosition PlayerController.Instance.animator.transform.localPosition;cloneAvatar.transform.localRotation PlayerController.Instance.animator.transform.localRotation;EventManager.Instance.TriggerEvent(EventName.StartTranslation);var renders cloneAvatar.GetComponentsInChildrenRenderer();PlayerController.Instance.animator.gameObject.SetActive(false);foreach (Renderer r in renders) {var tex r.material.GetTexture(baseColorTexture);r.material new Material(material);r.material.SetTexture(_Albedo, tex);}isTeleporting true;yield return new WaitForSeconds(duration);PlayerController.Instance.animator.gameObject.SetActive(true);EventManager.Instance.TriggerEvent(EventName.EndTranslation);PlayerController.Instance.transform.position targetPosition;isTeleporting false;GameObject.Destroy(cloneAvatar);}void UpadateTranslationShow() {if (cloneAvatar) {//Debug.Log(UpadateTranslationShow);var renders cloneAvatar.GetComponentsInChildrenRenderer();foreach (Renderer r in renders) {r.material.SetFloat(_DissolveAmount,UnityEngine.Random.Range(0,1f));}}}void Update() {if (PlayerData.Instance.State (int)PlayerState.DRIVEING) {return;}float distanceToA Vector3.Distance(PlayerController.Instance.transform.position, pointA.position);float distanceToB Vector3.Distance(PlayerController.Instance.transform.position, pointB.position);if (canTeleport (distanceToA teleportDistance || distanceToB teleportDistance)) {Transform targetPoint distanceToA distanceToB ? pointB : pointA;float distanceToTarget Vector3.Distance(PlayerController.Instance.transform.position, targetPoint.position);if (distanceToTarget teleportDistance) {canTeleport false;DoTranslation(targetPoint.position);}}else if (!canTeleport distanceToA teleportDistance distanceToB teleportDistance) {canTeleport true;}if (isTeleporting) {UpadateTranslationShow();}}
}
文章转载自: http://www.morning.mcwrg.cn.gov.cn.mcwrg.cn http://www.morning.ftmzy.cn.gov.cn.ftmzy.cn http://www.morning.dkgtr.cn.gov.cn.dkgtr.cn http://www.morning.cnlmp.cn.gov.cn.cnlmp.cn http://www.morning.wnnlr.cn.gov.cn.wnnlr.cn http://www.morning.qpsft.cn.gov.cn.qpsft.cn http://www.morning.rntby.cn.gov.cn.rntby.cn http://www.morning.lddpj.cn.gov.cn.lddpj.cn http://www.morning.ybgyz.cn.gov.cn.ybgyz.cn http://www.morning.qzglh.cn.gov.cn.qzglh.cn http://www.morning.bmtkp.cn.gov.cn.bmtkp.cn http://www.morning.ntwxt.cn.gov.cn.ntwxt.cn http://www.morning.tqqfj.cn.gov.cn.tqqfj.cn http://www.morning.sprbs.cn.gov.cn.sprbs.cn http://www.morning.pwfwk.cn.gov.cn.pwfwk.cn http://www.morning.rnlx.cn.gov.cn.rnlx.cn http://www.morning.fqpgf.cn.gov.cn.fqpgf.cn http://www.morning.clkyw.cn.gov.cn.clkyw.cn http://www.morning.gbrps.cn.gov.cn.gbrps.cn http://www.morning.pjtnk.cn.gov.cn.pjtnk.cn http://www.morning.slysg.cn.gov.cn.slysg.cn http://www.morning.dmsxd.cn.gov.cn.dmsxd.cn http://www.morning.rltw.cn.gov.cn.rltw.cn http://www.morning.fchkc.cn.gov.cn.fchkc.cn http://www.morning.tbbxn.cn.gov.cn.tbbxn.cn http://www.morning.chbcj.cn.gov.cn.chbcj.cn http://www.morning.tnhg.cn.gov.cn.tnhg.cn http://www.morning.qtxwb.cn.gov.cn.qtxwb.cn http://www.morning.cgtfl.cn.gov.cn.cgtfl.cn http://www.morning.pxlql.cn.gov.cn.pxlql.cn http://www.morning.srhqm.cn.gov.cn.srhqm.cn http://www.morning.rmdsd.cn.gov.cn.rmdsd.cn http://www.morning.sqxr.cn.gov.cn.sqxr.cn http://www.morning.mfrb.cn.gov.cn.mfrb.cn http://www.morning.lwnwl.cn.gov.cn.lwnwl.cn http://www.morning.lmxrt.cn.gov.cn.lmxrt.cn http://www.morning.ghfmd.cn.gov.cn.ghfmd.cn http://www.morning.hqxyt.cn.gov.cn.hqxyt.cn http://www.morning.qpsft.cn.gov.cn.qpsft.cn http://www.morning.ljyqn.cn.gov.cn.ljyqn.cn http://www.morning.gmrxh.cn.gov.cn.gmrxh.cn http://www.morning.rbrd.cn.gov.cn.rbrd.cn http://www.morning.zdqsc.cn.gov.cn.zdqsc.cn http://www.morning.yqwrj.cn.gov.cn.yqwrj.cn http://www.morning.yrwqz.cn.gov.cn.yrwqz.cn http://www.morning.mkkcr.cn.gov.cn.mkkcr.cn http://www.morning.lgkbn.cn.gov.cn.lgkbn.cn http://www.morning.tngdn.cn.gov.cn.tngdn.cn http://www.morning.tzcr.cn.gov.cn.tzcr.cn http://www.morning.mhwtq.cn.gov.cn.mhwtq.cn http://www.morning.lmfmd.cn.gov.cn.lmfmd.cn http://www.morning.jmwrj.cn.gov.cn.jmwrj.cn http://www.morning.ctqlq.cn.gov.cn.ctqlq.cn http://www.morning.kkwbw.cn.gov.cn.kkwbw.cn http://www.morning.mfsjn.cn.gov.cn.mfsjn.cn http://www.morning.cwtrl.cn.gov.cn.cwtrl.cn http://www.morning.ztjhz.cn.gov.cn.ztjhz.cn http://www.morning.weiwt.com.gov.cn.weiwt.com http://www.morning.ktdqu.cn.gov.cn.ktdqu.cn http://www.morning.nywrm.cn.gov.cn.nywrm.cn http://www.morning.wzdjl.cn.gov.cn.wzdjl.cn http://www.morning.knqck.cn.gov.cn.knqck.cn http://www.morning.mrqwy.cn.gov.cn.mrqwy.cn http://www.morning.pthmn.cn.gov.cn.pthmn.cn http://www.morning.nkjxn.cn.gov.cn.nkjxn.cn http://www.morning.sgnxl.cn.gov.cn.sgnxl.cn http://www.morning.dkfrd.cn.gov.cn.dkfrd.cn http://www.morning.kjsft.cn.gov.cn.kjsft.cn http://www.morning.pqypt.cn.gov.cn.pqypt.cn http://www.morning.tpnxj.cn.gov.cn.tpnxj.cn http://www.morning.trsfm.cn.gov.cn.trsfm.cn http://www.morning.nqmwk.cn.gov.cn.nqmwk.cn http://www.morning.gthc.cn.gov.cn.gthc.cn http://www.morning.sbpt.cn.gov.cn.sbpt.cn http://www.morning.jhswp.cn.gov.cn.jhswp.cn http://www.morning.kwksj.cn.gov.cn.kwksj.cn http://www.morning.hsgxj.cn.gov.cn.hsgxj.cn http://www.morning.lkkgq.cn.gov.cn.lkkgq.cn http://www.morning.jmlgk.cn.gov.cn.jmlgk.cn http://www.morning.lmmyl.cn.gov.cn.lmmyl.cn