diff options
92 files changed, 1646 insertions, 449 deletions
diff --git a/Assets/Art/Vfx/GrabSquaresEffect/Shaders.meta b/Assets/Art/Vfx/GrabSquaresEffect/Shaders.meta deleted file mode 100644 index fa9e76cd..00000000 --- a/Assets/Art/Vfx/GrabSquaresEffect/Shaders.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e38cb65072bb4a64cbe162792de9bec2 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Art/Models/Characters/Default.meta b/Assets/Bundle/Materials/Common.meta index 43499fc7..2dc8c0c1 100644 --- a/Assets/Art/Models/Characters/Default.meta +++ b/Assets/Bundle/Materials/Common.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e8a40298dd4efd14c9f90a63734ca39b +guid: ad166fa278dd3ad41a25aaeec66d37ab folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Bundle/Materials/Unit/ImageEffect/unit_img_motionBlur.mat b/Assets/Bundle/Materials/Unit/ImageEffect/unit_img_motion_blur.mat index 48d884ad..20c6e1f9 100644 --- a/Assets/Bundle/Materials/Unit/ImageEffect/unit_img_motionBlur.mat +++ b/Assets/Bundle/Materials/Unit/ImageEffect/unit_img_motion_blur.mat @@ -7,7 +7,7 @@ Material: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: unit_img_motionBlur + m_Name: unit_img_motion_blur m_Shader: {fileID: 4800000, guid: f0e5d0965cb119045abf4f057a692835, type: 3} m_ShaderKeywords: m_LightmapFlags: 4 @@ -64,6 +64,7 @@ Material: - _BumpScale: 1 - _Cutoff: 0.5 - _DetailNormalMapScale: 1 + - _Distance: 0 - _DstBlend: 0 - _GlossMapScale: 1 - _Glossiness: 0.5 diff --git a/Assets/Bundle/Materials/Unit/ImageEffect/unit_img_motionBlur.mat.meta b/Assets/Bundle/Materials/Unit/ImageEffect/unit_img_motion_blur.mat.meta index f5ce25ff..f5ce25ff 100644 --- a/Assets/Bundle/Materials/Unit/ImageEffect/unit_img_motionBlur.mat.meta +++ b/Assets/Bundle/Materials/Unit/ImageEffect/unit_img_motion_blur.mat.meta diff --git a/Assets/Bundle/Models.meta b/Assets/Bundle/Models.meta deleted file mode 100644 index c9b5bf44..00000000 --- a/Assets/Bundle/Models.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: adab1ca5f61452c4c90f19e7c11adf0e -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Prefabs.meta b/Assets/Bundle/Prefabs.meta deleted file mode 100644 index 82588fb1..00000000 --- a/Assets/Bundle/Prefabs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: dac6442cad7539149a7527510665d510 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Scenes/Demo/AnimationEditScene.unity b/Assets/Bundle/Scenes/Demo/AnimationEditScene.unity index efcb5238..290f59bd 100644 --- a/Assets/Bundle/Scenes/Demo/AnimationEditScene.unity +++ b/Assets/Bundle/Scenes/Demo/AnimationEditScene.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1} + m_IndirectSpecularColor: {r: 0.18028334, g: 0.22571328, b: 0.3069217, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -67385,6 +67385,7 @@ GameObject: - component: {fileID: 861741898} - component: {fileID: 861741901} - component: {fileID: 861741903} + - component: {fileID: 861741902} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -67431,7 +67432,7 @@ Camera: m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 - m_RenderingPath: -1 + m_RenderingPath: 1 m_TargetTexture: {fileID: 0} m_TargetDisplay: 0 m_TargetEye: 3 @@ -67455,7 +67456,7 @@ Transform: m_Children: [] m_Father: {fileID: 278122007} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: -14.21, y: 54.71, z: 0} --- !u!114 &861741901 MonoBehaviour: m_ObjectHideFlags: 0 @@ -67516,6 +67517,18 @@ MonoBehaviour: m_BeforeTransparentBundles: [] m_BeforeStackBundles: [] m_AfterStackBundles: [] +--- !u!114 &861741902 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 861741897} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 058dffdf2041d7d43902a7c301296bb2, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!114 &861741903 MonoBehaviour: m_ObjectHideFlags: 0 @@ -67529,6 +67542,47 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: offset: {x: 0, y: 1.2, z: 0} + z: -7.5 + region: + l: -0.1 + r: 0.1 + t: 0.1 + b: -0.1 + moveSpeed: 30 + speedCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: -0.053573478 + outSlope: -0.053573478 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0.1677485 + - serializedVersion: 3 + time: 0.5793689 + value: 0.73886395 + inSlope: -1.0201879 + outSlope: -1.0201879 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.15874855 + outWeight: 0.12042392 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: -1.7565603 + outSlope: -1.7565603 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + threshold: 1 --- !u!1 &998301198 GameObject: m_ObjectHideFlags: 0 @@ -201725,3 +201779,72 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 7 m_LocalEulerAnglesHint: {x: -137.82199, y: -87.41101, z: 86.146996} +--- !u!1001 &7723662135624581893 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 6928033330946439154, guid: 0b08ee7afb9df4649b0dd2cd0a3eeac7, + type: 3} + propertyPath: m_Name + value: Erika_Robot + objectReference: {fileID: 0} + - target: {fileID: 6930345995811640846, guid: 0b08ee7afb9df4649b0dd2cd0a3eeac7, + type: 3} + propertyPath: m_LocalPosition.x + value: 3.54 + objectReference: {fileID: 0} + - target: {fileID: 6930345995811640846, guid: 0b08ee7afb9df4649b0dd2cd0a3eeac7, + type: 3} + propertyPath: m_LocalPosition.y + value: 3.34 + objectReference: {fileID: 0} + - target: {fileID: 6930345995811640846, guid: 0b08ee7afb9df4649b0dd2cd0a3eeac7, + type: 3} + propertyPath: m_LocalPosition.z + value: -12.52 + objectReference: {fileID: 0} + - target: {fileID: 6930345995811640846, guid: 0b08ee7afb9df4649b0dd2cd0a3eeac7, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6930345995811640846, guid: 0b08ee7afb9df4649b0dd2cd0a3eeac7, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6930345995811640846, guid: 0b08ee7afb9df4649b0dd2cd0a3eeac7, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6930345995811640846, guid: 0b08ee7afb9df4649b0dd2cd0a3eeac7, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6930345995811640846, guid: 0b08ee7afb9df4649b0dd2cd0a3eeac7, + type: 3} + propertyPath: m_RootOrder + value: 11 + objectReference: {fileID: 0} + - target: {fileID: 6930345995811640846, guid: 0b08ee7afb9df4649b0dd2cd0a3eeac7, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6930345995811640846, guid: 0b08ee7afb9df4649b0dd2cd0a3eeac7, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6930345995811640846, guid: 0b08ee7afb9df4649b0dd2cd0a3eeac7, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 0b08ee7afb9df4649b0dd2cd0a3eeac7, type: 3} diff --git a/Assets/Art/Models/Characters/Erika2.meta b/Assets/Bundle/Shaders/Common.meta index fd7369d9..bb87a51a 100644 --- a/Assets/Art/Models/Characters/Erika2.meta +++ b/Assets/Bundle/Shaders/Common.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 077f81003f9fc564791cce182048c2b0 +guid: 174b504a5d32cf84daeee290b8470ff1 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Art/Vfx/GrabSquaresEffect/AbstractWiresEffect/Scripts.meta b/Assets/Bundle/Shaders/Common/Image.meta index b76e98a5..abeda856 100644 --- a/Assets/Art/Vfx/GrabSquaresEffect/AbstractWiresEffect/Scripts.meta +++ b/Assets/Bundle/Shaders/Common/Image.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 20381b3eecfbfe34a9d9222868969d29 +guid: c4f83cfe782b4d6408644387c887b5f9 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs b/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs new file mode 100644 index 00000000..a5603324 --- /dev/null +++ b/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class common_img_bloom : MonoBehaviour +{ + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs.meta b/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs.meta new file mode 100644 index 00000000..a94e86e5 --- /dev/null +++ b/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31492de5533444b49bab8c503b8c6d0f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_blur.shader b/Assets/Bundle/Shaders/Common/Image/common_img_blur.shader new file mode 100644 index 00000000..2cebb028 --- /dev/null +++ b/Assets/Bundle/Shaders/Common/Image/common_img_blur.shader @@ -0,0 +1,79 @@ +Shader "Erika/Common/Image/Blur" +{ + Properties + { + _MainTex("Texture", 2D) = "white" {} + _Angle("Angle", float) = 0 + _Distance("Distance", float) = 0 + } + + SubShader + { + Tags { "RenderType" = "Opaque" "Queue" = "Transparent-1"} + LOD 100 + + ZWrite Off + ZTest LEqual + + Blend SrcAlpha OneMinusSrcAlpha + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + }; + + sampler2D _MainTex; + float4 _MainTex_ST; + + float _Angle; + + fixed _Distance; + + v2f vert(appdata v) + { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = TRANSFORM_TEX(v.uv, _MainTex); + return o; + } + + fixed4 frag(v2f i) : SV_Target + { + _Angle = 0; + _Distance = 0.02f; + + fixed2 uv = i.uv; + fixed2 offset = fixed2(0.05, 0.05); + const float sampleCount = 30; + fixed4 color = fixed4(0,0,0,0); + float radian = radians(_Angle); + float distance = _Distance; + for (int i = 0; i < sampleCount; i++) + { + float dx = distance * cos(radian) / sampleCount * i; + float dy = distance * sin(radian) / sampleCount * i; + color += tex2D(_MainTex,float2(uv.x + dx,uv.y + dy)) * (1 / sampleCount); + } + //color = tex2D(_MainTex, uv); + return color; + } + ENDCG + } + } + +} // shader diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_blur.shader.meta b/Assets/Bundle/Shaders/Common/Image/common_img_blur.shader.meta new file mode 100644 index 00000000..8053135d --- /dev/null +++ b/Assets/Bundle/Shaders/Common/Image/common_img_blur.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 582d2065809e3814c98b6f0806996415 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Bundle/Shaders/Common/common_solid_color.shader b/Assets/Bundle/Shaders/Common/common_solid_color.shader new file mode 100644 index 00000000..031d4b69 --- /dev/null +++ b/Assets/Bundle/Shaders/Common/common_solid_color.shader @@ -0,0 +1,81 @@ +Shader "Erika/Common/SolidColor" +{ + Properties + { + _MainTex("Texture", 2D) = "white" {} + _Color("Color", Color) = (1,1,1,1) + } + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 100 + + ZTest LEqual + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + float4 screenPos : TEXCOORD2; + }; + + fixed4 _Color; + + sampler2D_float _CameraDepthTexture; + + float4x4 _ObjectToWorld; + + sampler2D _MainTex; + float4 _MainTex_ST; + + v2f vert (appdata v) + { + v2f o; + o.vertex = UnityWorldToClipPos(mul(_ObjectToWorld, v.vertex)); + //o.vertex = UnityWorldToClipPos(mul(unity_ObjectToWorld, v.vertex)); + o.screenPos = ComputeScreenPos(o.vertex); + o.uv = TRANSFORM_TEX(v.uv, _MainTex); + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + float4 c = float4(0, 0, 0, 0); + + float2 uv = i.screenPos.xy / i.screenPos.w; // normalized screen-space pos + float camDepth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); + camDepth = Linear01Depth(camDepth); // converts z buffer value to depth value from 0..1 + + float depth = i.screenPos.z / i.screenPos.w; +#if !UNITY_UV_STARTS_AT_TOP//OpenGL平台需要手动将[-1,1]映射到[0,1]模拟glDepthRange(0,1) + depth = (depth + 1) / 2; +#endif + depth = Linear01Depth(depth); + + float diff = saturate(depth - camDepth); + if (diff < 0.0001) + { + // c = _Color; + c = tex2D(_MainTex, i.uv); + } + + return c; + } + ENDCG + } + } +} diff --git a/Assets/Bundle/Shaders/Common/common_solid_color.shader.meta b/Assets/Bundle/Shaders/Common/common_solid_color.shader.meta new file mode 100644 index 00000000..c0777cb0 --- /dev/null +++ b/Assets/Bundle/Shaders/Common/common_solid_color.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e7ee93f26e570c24cbdef0b6ad1f461d +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Bundle/Shaders/Unit/Effect.meta b/Assets/Bundle/Shaders/Unit/Effect.meta deleted file mode 100644 index 7df9a033..00000000 --- a/Assets/Bundle/Shaders/Unit/Effect.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9cc4684b9f432f149b16a51f148c9490 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_colorDrift.shader b/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_color_drift.shader index 63e98344..f76b0a91 100644 --- a/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_colorDrift.shader +++ b/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_color_drift.shader @@ -1,58 +1,58 @@ -Shader "Unlit/unit_effect_colorDrift"
-{
- Properties
- {
- _MainTex ("Texture", 2D) = "white" {}
- }
- SubShader
- {
- Tags { "RenderType"="Opaque" }
- LOD 100
-
- Pass
- {
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- // make fog work
- #pragma multi_compile_fog
-
- #include "UnityCG.cginc"
-
- struct appdata
- {
- float4 vertex : POSITION;
- float2 uv : TEXCOORD0;
- };
-
- struct v2f
- {
- float2 uv : TEXCOORD0;
- UNITY_FOG_COORDS(1)
- float4 vertex : SV_POSITION;
- };
-
- sampler2D _MainTex;
- float4 _MainTex_ST;
-
- v2f vert (appdata v)
- {
- v2f o;
- o.vertex = UnityObjectToClipPos(v.vertex);
- o.uv = TRANSFORM_TEX(v.uv, _MainTex);
- UNITY_TRANSFER_FOG(o,o.vertex);
- return o;
- }
-
- fixed4 frag (v2f i) : SV_Target
- {
- // sample the texture
- fixed4 col = tex2D(_MainTex, i.uv);
- // apply fog
- UNITY_APPLY_FOG(i.fogCoord, col);
- return col;
- }
- ENDCG
- }
- }
-}
+Shader "Unlit/unit_effect_colorDrift" +{ + Properties + { + _MainTex ("Texture", 2D) = "white" {} + } + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 100 + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + // make fog work + #pragma multi_compile_fog + + #include "UnityCG.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + UNITY_FOG_COORDS(1) + float4 vertex : SV_POSITION; + }; + + sampler2D _MainTex; + float4 _MainTex_ST; + + v2f vert (appdata v) + { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = TRANSFORM_TEX(v.uv, _MainTex); + UNITY_TRANSFER_FOG(o,o.vertex); + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + // sample the texture + fixed4 col = tex2D(_MainTex, i.uv); + // apply fog + UNITY_APPLY_FOG(i.fogCoord, col); + return col; + } + ENDCG + } + } +} diff --git a/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_colorDrift.shader.meta b/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_color_drift.shader.meta index d42d528f..d42d528f 100644 --- a/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_colorDrift.shader.meta +++ b/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_color_drift.shader.meta diff --git a/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_motionBlur.shader b/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_motion_blur.shader index c5cfcf26..3111369a 100644 --- a/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_motionBlur.shader +++ b/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_motion_blur.shader @@ -4,8 +4,6 @@ Shader "Erika/Unit/ImageEffect/unit_img_motionBlur" Properties { _MainTex("Texture", 2D) = "white" {} - _BlurTex("Texture", 2D) = "black" {} - _MaskColor ("Mask Color", Color) = (1,1,1,1) _Angle("Angle", float) = 0 _Distance("Distance", float) = 0 } @@ -42,11 +40,6 @@ Shader "Erika/Unit/ImageEffect/unit_img_motionBlur" sampler2D _MainTex; float4 _MainTex_ST; - sampler2D _BlurTex; - float4 _BlurTex_ST; - - fixed4 _MaskColor; - float _Angle; fixed _Distance; @@ -62,18 +55,18 @@ Shader "Erika/Unit/ImageEffect/unit_img_motionBlur" fixed4 frag (v2f i) : SV_Target { fixed2 uv = i.uv; - fixed2 offset = fixed2(0.05, 0.05);
- const float sampleCount = 30;
- fixed4 color = fixed4(0,0,0,0);
- float radian = radians(_Angle);
- float distance = _Distance;
- for(int i = 0; i < sampleCount; i++)
- {
- float dx = distance * cos(radian) / sampleCount * i;
- float dy = distance * sin(radian) / sampleCount * i;
- color += tex2D(_MainTex,float2(uv.x + dx,uv.y + dy)) * (1 / sampleCount);
- }
- //color.rgb *= 0.5f;
+ fixed2 offset = fixed2(0.05, 0.05); + const float sampleCount = 30; + fixed4 color = fixed4(0,0,0,0); + float radian = radians(_Angle); + float distance = _Distance; + for(int i = 0; i < sampleCount; i++) + { + float dx = distance * cos(radian) / sampleCount * i; + float dy = distance * sin(radian) / sampleCount * i; + color += tex2D(_MainTex,float2(uv.x + dx,uv.y + dy)) * (1 / sampleCount); + } + //color.rgb *= 0.5f; return color; } ENDCG diff --git a/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_motionBlur.shader.meta b/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_motion_blur.shader.meta index 4afe3c18..4afe3c18 100644 --- a/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_motionBlur.shader.meta +++ b/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_motion_blur.shader.meta diff --git a/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_speedLine.shader b/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_speed_line.shader index fbc32eb5..b00673eb 100644 --- a/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_speedLine.shader +++ b/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_speed_line.shader @@ -1,58 +1,58 @@ -Shader "Unlit/unit_effect_speedLine"
-{
- Properties
- {
- _MainTex ("Texture", 2D) = "white" {}
- }
- SubShader
- {
- Tags { "RenderType"="Opaque" }
- LOD 100
-
- Pass
- {
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- // make fog work
- #pragma multi_compile_fog
-
- #include "UnityCG.cginc"
-
- struct appdata
- {
- float4 vertex : POSITION;
- float2 uv : TEXCOORD0;
- };
-
- struct v2f
- {
- float2 uv : TEXCOORD0;
- UNITY_FOG_COORDS(1)
- float4 vertex : SV_POSITION;
- };
-
- sampler2D _MainTex;
- float4 _MainTex_ST;
-
- v2f vert (appdata v)
- {
- v2f o;
- o.vertex = UnityObjectToClipPos(v.vertex);
- o.uv = TRANSFORM_TEX(v.uv, _MainTex);
- UNITY_TRANSFER_FOG(o,o.vertex);
- return o;
- }
-
- fixed4 frag (v2f i) : SV_Target
- {
- // sample the texture
- fixed4 col = tex2D(_MainTex, i.uv);
- // apply fog
- UNITY_APPLY_FOG(i.fogCoord, col);
- return col;
- }
- ENDCG
- }
- }
-}
+Shader "Unlit/unit_effect_speedLine" +{ + Properties + { + _MainTex ("Texture", 2D) = "white" {} + } + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 100 + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + // make fog work + #pragma multi_compile_fog + + #include "UnityCG.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + UNITY_FOG_COORDS(1) + float4 vertex : SV_POSITION; + }; + + sampler2D _MainTex; + float4 _MainTex_ST; + + v2f vert (appdata v) + { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = TRANSFORM_TEX(v.uv, _MainTex); + UNITY_TRANSFER_FOG(o,o.vertex); + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + // sample the texture + fixed4 col = tex2D(_MainTex, i.uv); + // apply fog + UNITY_APPLY_FOG(i.fogCoord, col); + return col; + } + ENDCG + } + } +} diff --git a/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_speedLine.shader.meta b/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_speed_line.shader.meta index 37726c12..37726c12 100644 --- a/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_speedLine.shader.meta +++ b/Assets/Bundle/Shaders/Unit/ImageEffect/unit_img_speed_line.shader.meta diff --git a/Assets/Art/Vfx/GrabSquaresEffect/Scripts.meta b/Assets/Bundle/Shaders/Unit/LensEffect.meta index 41200932..8870549b 100644 --- a/Assets/Art/Vfx/GrabSquaresEffect/Scripts.meta +++ b/Assets/Bundle/Shaders/Unit/LensEffect.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: abff7cb61c760094f8ab9437379e0f2c +guid: 8ea8530ead06b5646968d268799393e0 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Bundle/Shaders/Unit/LensEffect/unit_lens_motion_blur.shader b/Assets/Bundle/Shaders/Unit/LensEffect/unit_lens_motion_blur.shader new file mode 100644 index 00000000..9b8bec4c --- /dev/null +++ b/Assets/Bundle/Shaders/Unit/LensEffect/unit_lens_motion_blur.shader @@ -0,0 +1,62 @@ +//给RT做运动模糊 + +Shader "Unlit/unit_lens_motion_blur" +{ + Properties + { + _MainTex ("Texture", 2D) = "white" {} + } + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 100 + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + // make fog work + #pragma multi_compile_fog + + #include "UnityCG.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + UNITY_FOG_COORDS(1) + float4 vertex : SV_POSITION; + }; + + sampler2D _MainTex; + float4 _MainTex_ST; + + float4 _ScaleOffset; // 角色在RT中的位置 + + v2f vert (appdata v) + { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = TRANSFORM_TEX(v.uv, _MainTex); + UNITY_TRANSFER_FOG(o,o.vertex); + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + // sample the texture + fixed4 col = tex2D(_MainTex, i.uv); + // apply fog + UNITY_APPLY_FOG(i.fogCoord, col); + return col; + } + ENDCG + } + } +} diff --git a/Assets/Bundle/Shaders/Unit/LensEffect/unit_lens_motion_blur.shader.meta b/Assets/Bundle/Shaders/Unit/LensEffect/unit_lens_motion_blur.shader.meta new file mode 100644 index 00000000..896045f9 --- /dev/null +++ b/Assets/Bundle/Shaders/Unit/LensEffect/unit_lens_motion_blur.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7e03081c3480da045a4e3fd8050068ea +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Bundle/UI.meta b/Assets/Bundle/UI.meta deleted file mode 100644 index 0914914c..00000000 --- a/Assets/Bundle/UI.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4392471259b05a74a82a4bc72b510eb1 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Unit/Monster/Robots_Prowler/ActionData.meta b/Assets/Bundle/Unit/Monster/Robots_Prowler/ActionData.meta deleted file mode 100644 index ca7266b0..00000000 --- a/Assets/Bundle/Unit/Monster/Robots_Prowler/ActionData.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a1d7b6e0d8fb1a642a65011fb6cd7d89 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Unit/Monster/Robots_Prowler/Models/Materials/Robots_Prowel_Color 1.mat b/Assets/Bundle/Unit/Monster/Robots_Prowler/Models/Materials/Robots_Prowel_Color 1.mat index 02a9e7fb..0938b267 100644 --- a/Assets/Bundle/Unit/Monster/Robots_Prowler/Models/Materials/Robots_Prowel_Color 1.mat +++ b/Assets/Bundle/Unit/Monster/Robots_Prowler/Models/Materials/Robots_Prowel_Color 1.mat @@ -8,21 +8,90 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Robots_Prowel_Color 1 - m_Shader: {fileID: 10703, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: 1a97144e4ad27a04aafd70f7b915cedb, type: 3} m_ShaderKeywords: m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 - m_CustomRenderQueue: 3000 - stringTagMap: {} + m_CustomRenderQueue: -1 + stringTagMap: + RenderType: Opaque disabledShaderPasses: [] m_SavedProperties: serializedVersion: 3 m_TexEnvs: + - _BumpMap: + 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: ae6a0b7aee66e0b4cb826ec035ea55ec, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - m_Floats: [] + - _OutlineWidthTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ReceiveShadowTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadeTexture: + m_Texture: {fileID: 2800000, guid: ae6a0b7aee66e0b4cb826ec035ea55ec, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadingGradeTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SphereAdd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _UvAnimMaskTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _AlphaToMask: 0 + - _BlendMode: 0 + - _BumpScale: 1 + - _CullMode: 2 + - _Cutoff: 0.5 + - _DebugMode: 0 + - _DstBlend: 0 + - _IndirectLightIntensity: 0.1 + - _LightColorAttenuation: 0 + - _MToonVersion: 34 + - _OutlineColorMode: 0 + - _OutlineCullMode: 1 + - _OutlineLightingMix: 1 + - _OutlineScaledMaxDistance: 1 + - _OutlineWidth: 0.5 + - _OutlineWidthMode: 0 + - _ReceiveShadowRate: 1 + - _RimFresnelPower: 1 + - _RimLift: 0 + - _RimLightingMix: 0 + - _ShadeShift: 0 + - _ShadeToony: 0.9 + - _ShadingGradeRate: 1 + - _SrcBlend: 1 + - _UvAnimRotation: 0 + - _UvAnimScrollX: 0 + - _UvAnimScrollY: 0 + - _ZWrite: 1 m_Colors: - _Color: {r: 0.5882353, g: 0.5882353, b: 0.5882353, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 0, g: 0, b: 0, a: 1} + - _RimColor: {r: 0, g: 0, b: 0, a: 1} + - _ShadeColor: {r: 0.96999997, g: 0.81, b: 0.86, a: 1} diff --git a/Assets/Bundle/Unit/Monster/Robots_Prowler/UnitData.meta b/Assets/Bundle/Unit/Monster/Robots_Prowler/UnitData.meta deleted file mode 100644 index 142f5872..00000000 --- a/Assets/Bundle/Unit/Monster/Robots_Prowler/UnitData.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6ad7401709700f34db2b795830937d76 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Unit/NPC.meta b/Assets/Bundle/Unit/NPC.meta deleted file mode 100644 index eeea13e1..00000000 --- a/Assets/Bundle/Unit/NPC.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 8ced034d375cdfa488814663ea17a79b -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Unit/PC/Erika/AnimationData/Run.asset b/Assets/Bundle/Unit/PC/Erika/AnimationData/Run.asset index 4b218c2a..0e7e544f 100644 --- a/Assets/Bundle/Unit/PC/Erika/AnimationData/Run.asset +++ b/Assets/Bundle/Unit/PC/Erika/AnimationData/Run.asset @@ -14,6 +14,7 @@ MonoBehaviour: m_EditorClassIdentifier: animationName: Run animationPath: Assets/Bundle/Unit/PC/Erika/AnimationClip/Run.anim + note: animationEvents: [] hurtBoxes: - collider: @@ -74,21 +75,21 @@ MonoBehaviour: m_Curve: - serializedVersion: 3 time: 0 - value: 1.2 + value: 1.1 inSlope: 0 outSlope: 0 - tangentMode: 0 + tangentMode: 34 weightedMode: 0 inWeight: 0 - outWeight: 0 + outWeight: 0.33333334 - serializedVersion: 3 time: 1 - value: 1.2 + value: 1.1 inSlope: 0 outSlope: 0 - tangentMode: 0 + tangentMode: 34 weightedMode: 0 - inWeight: 0 + inWeight: 0.33333334 outWeight: 0 m_PreInfinity: 2 m_PostInfinity: 2 diff --git a/Assets/Bundle/Materials/Unit/Effect.meta b/Assets/Bundle/Unit/PC/Erika/Materials/Effect.meta index fdf8c1db..855459bb 100644 --- a/Assets/Bundle/Materials/Unit/Effect.meta +++ b/Assets/Bundle/Unit/PC/Erika/Materials/Effect.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0525fec1eb7cc94458170e9e106955d5 +guid: 3ab09dc0a18f20b4ea29507887e11428 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Bundle/Unit/PC/Erika/Materials/Normal.meta b/Assets/Bundle/Unit/PC/Erika/Materials/Normal.meta deleted file mode 100644 index 8c41a6b2..00000000 --- a/Assets/Bundle/Unit/PC/Erika/Materials/Normal.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5dc1b71affc68b54594096a1b96a5c00 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Unit/PC/Erika/Models.meta b/Assets/Bundle/Unit/PC/Erika/Models.meta deleted file mode 100644 index 11148d17..00000000 --- a/Assets/Bundle/Unit/PC/Erika/Models.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0d712421d808a43438a43d8a5d34effe -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Unit/PC/Erika/Prefabs/Erika_Robot.prefab b/Assets/Bundle/Unit/PC/Erika/Prefabs/Erika_Robot.prefab index e6332658..75d3780d 100644 --- a/Assets/Bundle/Unit/PC/Erika/Prefabs/Erika_Robot.prefab +++ b/Assets/Bundle/Unit/PC/Erika/Prefabs/Erika_Robot.prefab @@ -649,8 +649,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: showGizmos: 1 + root: {fileID: 6930221487356679114} afterImageAvatarPath: Assets/Bundle/Unit/PC/Erika/Prefabs/Erika_Robot_AfterImage.prefab - bones: + m_Bones: m_keys: 0000000001000000020000000300000004000000050000000600000007000000080000001400000015000000160000001700000018000000190000001a0000001b0000001c0000001d0000001e0000001f0000002000000021000000220000002300000024000000250000002600000028000000290000002a0000002b0000002c0000002d0000002e0000002f000000300000003100000032000000330000003400000035000000360000003700000038000000390000003a0000003c0000003d0000003e0000003f00000050000000510000005200000053000000 m_values: - {fileID: 6931910881339740176} @@ -708,16 +709,16 @@ MonoBehaviour: - {fileID: 6930399342477815872} - {fileID: 6931776861846272074} - {fileID: 6929941362883253820} - referencePoints: + m_ReferencePoints: m_keys: 0100000014000000 m_values: - {fileID: 0} - {fileID: 0} snapshotBound: 5 - mainRenderer: + m_MainRenderer: tag: 0 renderer: {fileID: 7046772783541976850} - renderers: + m_Renderers: - tag: 0 renderer: {fileID: 7046772783541976850} --- !u!1 &6928056367075676882 diff --git a/Assets/Bundle/Unit/PC/Erika/UnitData.meta b/Assets/Bundle/Unit/PC/Erika/UnitData.meta deleted file mode 100644 index 7d4b13eb..00000000 --- a/Assets/Bundle/Unit/PC/Erika/UnitData.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 922befa8a94692845b88500a23229d7f -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Unit/PC/Erika/Weapons/Materials.meta b/Assets/Bundle/Unit/PC/Erika/Weapons/Materials.meta new file mode 100644 index 00000000..be6badd6 --- /dev/null +++ b/Assets/Bundle/Unit/PC/Erika/Weapons/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2c46a5a23283c7d428ae8bb13663ab6a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Bundle/Unit/PC/ErikaCyborg/ActionData.meta b/Assets/Bundle/Unit/PC/ErikaCyborg/ActionData.meta deleted file mode 100644 index f5434a00..00000000 --- a/Assets/Bundle/Unit/PC/ErikaCyborg/ActionData.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 07c3b2bf6cb8cc2498422bbb105cbad8 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Unit/PC/ErikaCyborg/AnimationClip.meta b/Assets/Bundle/Unit/PC/ErikaCyborg/AnimationClip.meta deleted file mode 100644 index 4ed2c938..00000000 --- a/Assets/Bundle/Unit/PC/ErikaCyborg/AnimationClip.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 827d77abe87680a47ae2d71a9e953a18 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Unit/PC/ErikaCyborg/AnimationData.meta b/Assets/Bundle/Unit/PC/ErikaCyborg/AnimationData.meta deleted file mode 100644 index 43a52cd1..00000000 --- a/Assets/Bundle/Unit/PC/ErikaCyborg/AnimationData.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7a2b72fbb41383047ac45e6c22ea9663 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Unit/PC/ErikaCyborg/Materials/AfterImage.meta b/Assets/Bundle/Unit/PC/ErikaCyborg/Materials/AfterImage.meta deleted file mode 100644 index 85d58a8c..00000000 --- a/Assets/Bundle/Unit/PC/ErikaCyborg/Materials/AfterImage.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b2b0838fb0603964e99904eefe81ad7f -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Unit/PC/ErikaCyborg/Materials/Normal.meta b/Assets/Bundle/Unit/PC/ErikaCyborg/Materials/Normal.meta deleted file mode 100644 index dd867045..00000000 --- a/Assets/Bundle/Unit/PC/ErikaCyborg/Materials/Normal.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1c8a678ea9e801f439a1003d04f33cf5 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Unit/PC/ErikaCyborg/Models.meta b/Assets/Bundle/Unit/PC/ErikaCyborg/Models.meta deleted file mode 100644 index dc530723..00000000 --- a/Assets/Bundle/Unit/PC/ErikaCyborg/Models.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ebf636c7cf7b1934b885298ce1f5f42e -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Unit/PC/ErikaCyborg/RootMotion.meta b/Assets/Bundle/Unit/PC/ErikaCyborg/RootMotion.meta deleted file mode 100644 index b28b6f04..00000000 --- a/Assets/Bundle/Unit/PC/ErikaCyborg/RootMotion.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2022e8298d3a8624992143eb57c0f8ac -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Unit/PC/ErikaCyborg/UnitData.meta b/Assets/Bundle/Unit/PC/ErikaCyborg/UnitData.meta deleted file mode 100644 index eeca0d3b..00000000 --- a/Assets/Bundle/Unit/PC/ErikaCyborg/UnitData.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f6aa859c834c51f498ef0b3c3b83a0f5 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Unit/PC/ErikaCyborg/Weapons.meta b/Assets/Bundle/Unit/PC/ErikaCyborg/Weapons.meta deleted file mode 100644 index 7f91da28..00000000 --- a/Assets/Bundle/Unit/PC/ErikaCyborg/Weapons.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: df69962f5b01e444a8bea87e31c7d0a4 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Unit/Prop.meta b/Assets/Bundle/Unit/Prop.meta deleted file mode 100644 index affd6eed..00000000 --- a/Assets/Bundle/Unit/Prop.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: dafc173db1ebeab4c80641cc3d4fa528 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Data.meta b/Assets/Data.meta new file mode 100644 index 00000000..0eb1943b --- /dev/null +++ b/Assets/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 26b51aee92a7a9049aac535164143481 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Data/RootMotionData.meta b/Assets/Data/RootMotionData.meta new file mode 100644 index 00000000..14abf402 --- /dev/null +++ b/Assets/Data/RootMotionData.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5cfee9bde9754254f83510f88dd2a19b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Camera.meta b/Assets/Scripts/Camera.meta new file mode 100644 index 00000000..139bddae --- /dev/null +++ b/Assets/Scripts/Camera.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 10934c4669147044897200abc6f23a05 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Camera/LensEffectHandler.cs b/Assets/Scripts/Camera/LensEffectHandler.cs new file mode 100644 index 00000000..63114535 --- /dev/null +++ b/Assets/Scripts/Camera/LensEffectHandler.cs @@ -0,0 +1,35 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[RequireComponent(typeof(Camera))] +public class LensEffectHandler : MonoBehaviour +{ + Camera m_Camera; + + public delegate void RenderEventHandler(); + public event RenderEventHandler onPreCull; + public event RenderEventHandler onPreRender; + public event RenderEventHandler onPostRender; + + private void OnEable() + { + m_Camera = GetComponent<Camera>(); + } + + private void OnPreCull() + { + onPreCull?.Invoke(); + } + + private void OnPreRender() + { + onPreRender?.Invoke(); + } + + private void OnPostRender() + { + onPostRender?.Invoke(); + } + +} diff --git a/Assets/Scripts/Camera/LensEffectHandler.cs.meta b/Assets/Scripts/Camera/LensEffectHandler.cs.meta new file mode 100644 index 00000000..cf914200 --- /dev/null +++ b/Assets/Scripts/Camera/LensEffectHandler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 058dffdf2041d7d43902a7c301296bb2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Camera/MainCamera.cs b/Assets/Scripts/Camera/MainCamera.cs new file mode 100644 index 00000000..f439cf22 --- /dev/null +++ b/Assets/Scripts/Camera/MainCamera.cs @@ -0,0 +1,153 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +// 主相机 +[ExecuteAlways] +public class MainCamera : SingletonMB<MainCamera> +{ + #region inspector + [Serializable] + public struct Region + { + [SerializeField] public float l; + [SerializeField] public float r; + [SerializeField] public float t; + [SerializeField] public float b; + } + + public new Camera camera { get; private set; } + + public Vector3 offset = Vector3.zero; + + [SerializeField] private float z; + + [SerializeField] private Region region; + + [SerializeField] private float moveSpeed; + + [SerializeField] private AnimationCurve speedCurve; + + [SerializeField] private float threshold; + #endregion + + private LensEffectHandler m_LensEffectHandler; + public LensEffectHandler lensEffectHandler + { + get + { + if (m_LensEffectHandler == null) + m_LensEffectHandler = this.gameObject.GetOrAddComponent<LensEffectHandler>(); + return m_LensEffectHandler; + } + } + + private Vector2 position2D + { + get + { + return transform.position; + } + set + { + transform.position = new Vector3(value.x, value.y, transform.position.z); + } + } + + private Vector3 position + { + get + { + return transform.position; + } + set + { + transform.position = value; + } + } + + protected override void Awake() + { + base.Awake(); + camera = gameObject.GetComponent<Camera>(); + } + + private void Start() + { + Vector3 pos = transform.position; + pos.z = this.z; + transform.position = pos; + + Quaternion rot = Quaternion.LookRotation(Vector3.forward); + transform.rotation = rot; + } + + void FollowPlayerCharacter() + { + if (UnitManager.Instance == null || UnitManager.Instance.pc == null) + return; + + Region region = this.region; + + //if (!UnitManager.Instance.pc.isTowardRight) + //{ + // region.l = -this.region.r; + // region.r = -this.region.l; + //} + + Vector3 camPos = position; + + Vector3 worldPos = UnitManager.Instance.pc.transform.position + offset; + + Vector2 viewPos = ((Vector2)camera.WorldToViewportPoint(worldPos)) * 2 - Vector2.one; + + Vector3 dir = (worldPos - camPos).normalized; + float dest = (worldPos - camPos).magnitude; + float curve = speedCurve.Evaluate((threshold - Mathf.Clamp(dest, 0f, threshold)) / threshold); + Vector3 move = curve * dir * moveSpeed * Time.deltaTime; + + if (IsInRegion(viewPos, region)) + { + if(!IsInCenter(viewPos)) + { + position2D = camPos + move; + if((worldPos - position).magnitude <= 0.1f) + { + position2D = worldPos; + } + } + return; + } + position2D = camPos + move; + if ((worldPos - position).magnitude <= 0.1f) + { + position2D = worldPos; + } + } + + bool IsInRegion(Vector2 p, Region region) + { + return p.x > region.l + && p.x < region.r + && p.y > region.b + && p.y < region.t; + } + + bool IsInCenter(Vector2 p) + { + return p.x == (region.l + region.r) / 2 && p.y == (region.t + region.b) / 2; + } + + void Update() + { + FollowPlayerCharacter(); + } + + public void OnGUI() + { + if(MainCameraDebug.OnGUIHandlers != null) + MainCameraDebug.OnGUIHandlers.Invoke(); + } + +}
\ No newline at end of file diff --git a/Assets/Scripts/Scene/MainCamera.cs.meta b/Assets/Scripts/Camera/MainCamera.cs.meta index 1ad6678e..1ad6678e 100644 --- a/Assets/Scripts/Scene/MainCamera.cs.meta +++ b/Assets/Scripts/Camera/MainCamera.cs.meta diff --git a/Assets/Scripts/Camera/MainCameraDebug.cs b/Assets/Scripts/Camera/MainCameraDebug.cs new file mode 100644 index 00000000..7a8382ee --- /dev/null +++ b/Assets/Scripts/Camera/MainCameraDebug.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class MainCameraDebug +{ + public static Action OnGUIHandlers; + +} diff --git a/Assets/Scripts/Camera/MainCameraDebug.cs.meta b/Assets/Scripts/Camera/MainCameraDebug.cs.meta new file mode 100644 index 00000000..71e9cdb8 --- /dev/null +++ b/Assets/Scripts/Camera/MainCameraDebug.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31f8e21379e822447b55a74c799469f6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Curve3D.meta b/Assets/Scripts/Curve3D.meta deleted file mode 100644 index fef1c5e7..00000000 --- a/Assets/Scripts/Curve3D.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ad8b718b6b700d8419838dad07158567 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Data/EnumDefine.cs b/Assets/Scripts/Data/EnumDefine.cs new file mode 100644 index 00000000..ad55986f --- /dev/null +++ b/Assets/Scripts/Data/EnumDefine.cs @@ -0,0 +1,22 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + + +// unit image effect枚举 +public enum EImageEffectMaterails +{ + MotionBlur, + Glitch, + ColorDrift, +} + +public enum EShader +{ + Blur, + + + SolidColor, + +} + diff --git a/Assets/Scripts/Data/EnumDefine.cs.meta b/Assets/Scripts/Data/EnumDefine.cs.meta new file mode 100644 index 00000000..a8332e9b --- /dev/null +++ b/Assets/Scripts/Data/EnumDefine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e8e2ae14bb9405d47a5b2ff142dcff1a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Data/StaticDefine.cs b/Assets/Scripts/Data/StaticDefine.cs index 833b3ec1..236e0621 100644 --- a/Assets/Scripts/Data/StaticDefine.cs +++ b/Assets/Scripts/Data/StaticDefine.cs @@ -2,20 +2,26 @@ using System.Collections.Generic;
using UnityEngine;
-public enum EImageEffectMaterails
-{
- MotionBlur,
- Glitch,
- ColorDrift,
-}
-
public static class StaticDefine
{
+ // unit image用到的材质
public static Dictionary<EImageEffectMaterails, string/*path*/> imageEffectMaterails = new Dictionary<EImageEffectMaterails, string>() {
- { EImageEffectMaterails.MotionBlur, "Assets/Bundle/Materials/Unit/ImageEffect/unit_img_motionBlur.mat"},
+ { EImageEffectMaterails.MotionBlur, "Assets/Bundle/Materials/Unit/ImageEffect/unit_img_motion_blur.mat"},
{ EImageEffectMaterails.Glitch, "Assets/Bundle/Materials/Unit/ImageEffect/unit_img_glitch.mat"},
};
- public static string bundleManifest = "bundles"; // Assets/Resources/bundles.json
+
+ public struct ShaderDefine
+ {
+ public ShaderDefine(string n, string p) { name = n; path = p; }
+ public string name;
+ public string path;
+ }
+ public static Dictionary<EShader, ShaderDefine> shaders = new Dictionary<EShader, ShaderDefine> {
+ { EShader.Blur, new ShaderDefine("Erika/Common/Image/Blur", "")},
+ { EShader.SolidColor, new ShaderDefine("Erika/Common/SolidColor", "") },
+ };
+
+ public static string bundleManifest = "bundles"; // Assets/Resources/bundles.json
}
diff --git a/Assets/Scripts/Drone.meta b/Assets/Scripts/Drone.meta deleted file mode 100644 index 694cff70..00000000 --- a/Assets/Scripts/Drone.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ec3412151f8a72a41b2ed21316763399 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Editor.meta b/Assets/Scripts/Editor.meta new file mode 100644 index 00000000..b8bb2b0e --- /dev/null +++ b/Assets/Scripts/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c08fbb77c6ad1ed4c9499d0fcb73773f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/InspectorUtility.cs b/Assets/Scripts/Editor/InspectorUtility.cs new file mode 100644 index 00000000..5c1e6e05 --- /dev/null +++ b/Assets/Scripts/Editor/InspectorUtility.cs @@ -0,0 +1,169 @@ +using UnityEngine; +using UnityEditor; +using System; +using System.Collections.Generic; +using System.IO; + +/// <summary> +/// Collection of tools and helpers for drawing inspectors +/// </summary> +public class InspectorUtility +{ + /// <summary>Put multiple properties on a single inspector line, with + /// optional label overrides. Passing null as a label (or sublabel) override will + /// cause the property's displayName to be used as a label. For no label at all, + /// pass GUIContent.none.</summary> + /// <param name="rect">Rect in which to draw</param> + /// <param name="label">Main label</param> + /// <param name="props">Properties to place on the line</param> + /// <param name="subLabels">Sublabels for the properties</param> + public static void MultiPropertyOnLine( + Rect rect, + GUIContent label, + SerializedProperty[] props, GUIContent[] subLabels) + { + if (props == null || props.Length == 0) + return; + + const int hSpace = 2; + int indentLevel = EditorGUI.indentLevel; + float labelWidth = EditorGUIUtility.labelWidth; + + float totalSubLabelWidth = 0; + int numBoolColumns = 0; + List<GUIContent> actualLabels = new List<GUIContent>(); + for (int i = 0; i < props.Length; ++i) + { + GUIContent sublabel = new GUIContent(props[i].displayName, props[i].tooltip); + if (subLabels != null && subLabels.Length > i && subLabels[i] != null) + sublabel = subLabels[i]; + actualLabels.Add(sublabel); + totalSubLabelWidth += GUI.skin.label.CalcSize(sublabel).x; + if (i > 0) + totalSubLabelWidth += hSpace; + // Special handling for toggles, or it looks stupid + if (props[i].propertyType == SerializedPropertyType.Boolean) + { + totalSubLabelWidth += rect.height; + ++numBoolColumns; + } + } + + float subFieldWidth = rect.width - labelWidth - totalSubLabelWidth; + float numCols = props.Length - numBoolColumns; + float colWidth = numCols == 0 ? 0 : subFieldWidth / numCols; + + // Main label. If no first sublabel, then main label must take on that + // role, for mouse dragging value-scrolling support + int subfieldStartIndex = 0; + if (label == null) + label = new GUIContent(props[0].displayName, props[0].tooltip); + if (actualLabels[0] != GUIContent.none) + rect = EditorGUI.PrefixLabel(rect, label); + else + { + rect.width = labelWidth + colWidth; + EditorGUI.PropertyField(rect, props[0], label); + rect.x += rect.width + hSpace; + subfieldStartIndex = 1; + } + + for (int i = subfieldStartIndex; i < props.Length; ++i) + { + EditorGUI.indentLevel = 0; + EditorGUIUtility.labelWidth = GUI.skin.label.CalcSize(actualLabels[i]).x; + if (props[i].propertyType == SerializedPropertyType.Boolean) + { + rect.width = EditorGUIUtility.labelWidth + rect.height; + props[i].boolValue = EditorGUI.ToggleLeft(rect, actualLabels[i], props[i].boolValue); + } + else + { + rect.width = EditorGUIUtility.labelWidth + colWidth; + EditorGUI.PropertyField(rect, props[i], actualLabels[i]); + } + rect.x += rect.width + hSpace; + } + + EditorGUIUtility.labelWidth = labelWidth; + EditorGUI.indentLevel = indentLevel; + } + + /// <summary> + /// Normalize a curve so that each of X and Y axes ranges from 0 to 1 + /// </summary> + /// <param name="curve">Curve to normalize</param> + /// <returns>The normalized curve</returns> + public static AnimationCurve NormalizeCurve(AnimationCurve curve) + { + Keyframe[] keys = curve.keys; + if (keys.Length > 0) + { + float minTime = keys[0].time; + float maxTime = minTime; + float minVal = keys[0].value; + float maxVal = minVal; + for (int i = 0; i < keys.Length; ++i) + { + minTime = Mathf.Min(minTime, keys[i].time); + maxTime = Mathf.Max(maxTime, keys[i].time); + minVal = Mathf.Min(minVal, keys[i].value); + maxVal = Mathf.Max(maxVal, keys[i].value); + } + float range = maxTime - minTime; + float timeScale = range < 0.0001f ? 1 : 1 / range; + range = maxVal - minVal; + float valScale = range < 1 ? 1 : 1 / range; + float valOffset = 0; + if (range < 1) + { + if (minVal > 0 && minVal + range <= 1) + valOffset = minVal; + else + valOffset = 1 - range; + } + for (int i = 0; i < keys.Length; ++i) + { + keys[i].time = (keys[i].time - minTime) * timeScale; + keys[i].value = ((keys[i].value - minVal) * valScale) + valOffset; + } + curve.keys = keys; + } + return curve; + } + + /// <summary> + /// Remove the "Cinemachine" prefix, then call the standard Unity Nicify. + /// </summary> + /// <param name="name">The name to nicify</param> + /// <returns>The nicified name</returns> + public static string NicifyClassName(string name) + { + if (name.StartsWith("Cinemachine")) + name = name.Substring(11); // Trim the prefix + return ObjectNames.NicifyVariableName(name); + } + + // Temporarily here + /// <summary> + /// Create a game object. Uses ObjectFactory if the Unity version is sufficient. + /// </summary> + /// <param name="name">Name to give the object</param> + /// <param name="types">Optional components to add</param> + /// <returns></returns> + public static GameObject CreateGameObject(string name, params Type[] types) + { + return ObjectFactory.CreateGameObject(name, types); + } + + /// <summary> + /// Force a repaint of the Game View + /// </summary> + /// <param name="unused">Like it says</param> + public static void RepaintGameView(UnityEngine.Object unused = null) + { + EditorApplication.QueuePlayerLoopUpdate(); + UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + } + +} diff --git a/Assets/Scripts/Editor/InspectorUtility.cs.meta b/Assets/Scripts/Editor/InspectorUtility.cs.meta new file mode 100644 index 00000000..f2152bda --- /dev/null +++ b/Assets/Scripts/Editor/InspectorUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ae9f2927fa60f654889df3571b579c86 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Editor/MainCameraEditor.cs b/Assets/Scripts/Editor/MainCameraEditor.cs new file mode 100644 index 00000000..437303a0 --- /dev/null +++ b/Assets/Scripts/Editor/MainCameraEditor.cs @@ -0,0 +1,45 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +[CustomEditor(typeof(MainCamera))] +public class MainCameraEditor : Editor +{ + + private void OnEnable() + { + MainCameraDebug.OnGUIHandlers -= OnGameViewGUI; + MainCameraDebug.OnGUIHandlers += OnGameViewGUI; + } + + private void OnDisable() + { + MainCameraDebug.OnGUIHandlers -= OnGameViewGUI; + + InspectorUtility.RepaintGameView(); + } + + public override void OnInspectorGUI() + { + base.OnInspectorGUI(); + } + + private void OnGameViewGUI() + { + MainCamera camera = target as MainCamera; + if (camera == null) + return; + + //Matrix4x4 oldMatrix = GUI.matrix; + //Rect cameraRect = new Rect(0, 0, 500, 500); + + //GUI.matrix = Matrix4x4.Translate(cameraRect.min); + + ////GUILayout.Button("test"); + //GUI.DrawTexture(new Rect(0, 0, 30, 30), Texture2D.whiteTexture); + + //GUI.matrix = oldMatrix; + } + +} diff --git a/Assets/Scripts/Editor/MainCameraEditor.cs.meta b/Assets/Scripts/Editor/MainCameraEditor.cs.meta new file mode 100644 index 00000000..76d6d4b1 --- /dev/null +++ b/Assets/Scripts/Editor/MainCameraEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eeb2aab4ac403f9429e87defed16c4a5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Managers/Physics.meta b/Assets/Scripts/Managers/Physics.meta deleted file mode 100644 index 2296b3f8..00000000 --- a/Assets/Scripts/Managers/Physics.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 603d4624aaedd794cb89497954a83f4a -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Props.meta b/Assets/Scripts/Props.meta deleted file mode 100644 index bb96602e..00000000 --- a/Assets/Scripts/Props.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f299520ed9fcf4a45858ad4ef5a8d5d1 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Robot.meta b/Assets/Scripts/Robot.meta deleted file mode 100644 index 0b5a087e..00000000 --- a/Assets/Scripts/Robot.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7c09ca1609552d24bbe697d1516f8aa9 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Scene/MainCamera.cs b/Assets/Scripts/Scene/MainCamera.cs deleted file mode 100644 index 45399ceb..00000000 --- a/Assets/Scripts/Scene/MainCamera.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class MainCamera : SingletonMB<MainCamera>
-{
- public new Camera camera { get; private set; }
-
- public Vector3 offset = Vector3.zero;
-
- protected override void Awake()
- {
- base.Awake();
- camera = gameObject.GetComponent<Camera>();
- }
-
- void Update()
- {
- if (TestErika.Instance.erika.unitController == null)
- {
- return;
- }
- Vector3 pos = transform.position;
- pos.x = TestErika.Instance.erika.unitController.transform.position.x;
- pos.y = TestErika.Instance.erika.unitController.transform.position.y;
- transform.position = pos + offset;
- }
-
-}
\ No newline at end of file diff --git a/Assets/Scripts/Unit/AI/Actions.meta b/Assets/Scripts/Unit/AI/Actions.meta deleted file mode 100644 index 9b4ad463..00000000 --- a/Assets/Scripts/Unit/AI/Actions.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 971e9d55b8bc0894eb6a110fb962000b -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Unit/AI/Conditionals.meta b/Assets/Scripts/Unit/AI/Conditionals.meta deleted file mode 100644 index 70a86da5..00000000 --- a/Assets/Scripts/Unit/AI/Conditionals.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 85b7e0c7ed1d12f42a5178bfbf3d934c -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Unit/Components/UnitAfterImage.cs b/Assets/Scripts/Unit/Components/UnitAfterImage.cs index 369f63c9..622e87ba 100644 --- a/Assets/Scripts/Unit/Components/UnitAfterImage.cs +++ b/Assets/Scripts/Unit/Components/UnitAfterImage.cs @@ -2,6 +2,8 @@ using System.Collections.Generic; using UnityEngine; +// Unit残影,通过复制avatar实现 + public class AfterImageSpawner { private float m_CurTime; diff --git a/Assets/Scripts/Unit/Components/UnitImageEffect.cs b/Assets/Scripts/Unit/Components/UnitImageEffect.cs index 4681826f..fcdd5c1f 100644 --- a/Assets/Scripts/Unit/Components/UnitImageEffect.cs +++ b/Assets/Scripts/Unit/Components/UnitImageEffect.cs @@ -1,7 +1,9 @@ using System.Collections; using System.Collections.Generic; -using UnityEngine; - +using UnityEngine;
+
+// Unit的一种后处理效果,渲染到一个RT上,对这个RT做效果
+
public class UnitImageEffectHolder { public float size; @@ -30,7 +32,6 @@ public class UnitImageEffectHandle public UnitImageEffectEndCallback onStop; } -//Unit后处理效果 public class UnitImageEffect : UnitComponent { public List<UnitImageEffectHandle> effects = new List<UnitImageEffectHandle>(); @@ -125,9 +126,10 @@ public class UnitImageEffect : UnitComponent holder.gameObject.transform.position = Vector3.zero; holders.Add(holder); holder = null; - } - - + }
+
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
public void ShowMotionBlur(float lifeTime, float angle, float distance) { UnitImageEffectHandle handle = m_HandlePool.Get(); diff --git a/Assets/Scripts/Unit/Components/UnitLensEffect.cs b/Assets/Scripts/Unit/Components/UnitLensEffect.cs new file mode 100644 index 00000000..4b710aa4 --- /dev/null +++ b/Assets/Scripts/Unit/Components/UnitLensEffect.cs @@ -0,0 +1,128 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering; + +//https://docs.unity3d.com/ScriptReference/Rendering.RenderTargetIdentifier.html + +// Unit效果之一,镜头效果,通过command buffer实现 + +//public class MaterailEntry +//{ +// public Material material; +//} + +public class UnitLensEffect : UnitComponent +{ + private List<RendererProxy> renderers; + + private static ObjectPool<CommandBuffer> m_CommandBufferPool = new ObjectPool<CommandBuffer>(null, null); + + CommandBuffer m_CommandBuffer; + + public override void Initialize() + { + base.Initialize(); + + renderers = new List<RendererProxy>(); + } + + public override void OnPostInitialize() + { + base.OnPostInitialize(); + + IBodyRendererAgent body = owner.unitRender.body; + if (body == null || body.renderers == null) + return; + for (int i = 0; i < body.renderers.Length; ++i) + { + var renderer = body.renderers[i]; + if (renderer == null) + continue; + RendererProxy proxy = renderer.renderer.gameObject.GetOrAddComponent<RendererProxy>(); + proxy.Initialize(renderer); + proxy.onWillRenderObject = OnWillRenderObject; + proxy.onRenderObject = OnRenderObject; + renderers.Add(proxy); + } + + m_CommandBuffer = ClaimCommandBuffer(); + + MainCamera.Instance.lensEffectHandler.onPreCull += OnWillRenderUnit; + MainCamera.Instance.lensEffectHandler.onPostRender += OnRenderUnit; + } + + public override void Release() + { + base.Release(); + + MainCamera.Instance.lensEffectHandler.onPreRender -= OnWillRenderUnit; + MainCamera.Instance.lensEffectHandler.onPostRender -= OnRenderUnit; + } + + private void OnWillRenderUnit() + { + m_CommandBuffer.Clear(); + + MainCamera.Instance.camera.AddCommandBuffer(CameraEvent.BeforeImageEffectsOpaque, m_CommandBuffer); + } + + private void OnRenderUnit() + { + + MainCamera.Instance.camera.RemoveCommandBuffer(CameraEvent.BeforeImageEffectsOpaque, m_CommandBuffer); + } + + private void OnWillRenderObject(BodyPartRenderer renderer) + { + //Camera cam = SceneManager.Instance.mainCamera; + //if (cam == null) + // return; + //Material mat = new Material(Shader.Find(StaticDefine.shaders[EShader.SolidColor].name)); + //mat.SetColor("_Color", Color.red); + + //Matrix4x4 obj2Wod = Matrix4x4.identity; + ////obj2Wod = TransformUtility.GetLocalToWorldMatrixRootBone(owner.unitDetail.rootBone.transform); + //Vector3 pos = owner.unitDetail.rootBone.transform.position; + //Quaternion rot = owner.unitDetail.rootBone.transform.rotation; + //obj2Wod = MatrixUtility.RotateAndTranslate(pos, rot); + //mat.SetMatrix("_ObjectToWorld", obj2Wod); + //mat.SetTexture("_MainTex", renderer.renderer.material.GetTexture("_MainTex")); + + //cb.Clear(); + //cb.name = "Unit Renderer"; + + //// create render texture for glow map + //int tempID = Shader.PropertyToID("_Temp1"); + //cb.GetTemporaryRT(tempID, -1, -1, 24, FilterMode.Bilinear); + //cb.SetRenderTarget(tempID); + //cb.ClearRenderTarget(true, true, new Color(0, 0, 0, 0)); + //cb.DrawRenderer(renderer.renderer, mat); + + //cb.SetRenderTarget(BuiltinRenderTextureType.CameraTarget); + //Material blur = new Material(Shader.Find(StaticDefine.shaders[EShader.Blur].name)); + //cb.Blit(tempID, BuiltinRenderTextureType.CameraTarget, blur); + + //cam.AddCommandBuffer(CameraEvent.AfterImageEffectsOpaque, cb); + } + + private void OnRenderObject(BodyPartRenderer renderer) + { + //Camera cam = SceneManager.Instance.mainCamera; + //cam.RemoveCommandBuffer(CameraEvent.AfterImageEffectsOpaque, cb); + } + + static CommandBuffer ClaimCommandBuffer() + { + CommandBuffer cb = m_CommandBufferPool.Get(); + cb.Clear(); + return cb; + } + + static void ReleaseCommandBuffer(ref CommandBuffer cb) + { + m_CommandBufferPool.Release(cb); + cb = null; + } + +} diff --git a/Assets/Scripts/Unit/Components/UnitLensEffect.cs.meta b/Assets/Scripts/Unit/Components/UnitLensEffect.cs.meta new file mode 100644 index 00000000..5a91ee87 --- /dev/null +++ b/Assets/Scripts/Unit/Components/UnitLensEffect.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d2d69fdca26298548ba2c146496c33c3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Unit/Components/UnitPostEffect.cs b/Assets/Scripts/Unit/Components/UnitPostEffect.cs new file mode 100644 index 00000000..ad98ff6a --- /dev/null +++ b/Assets/Scripts/Unit/Components/UnitPostEffect.cs @@ -0,0 +1,15 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class UnitPostEffect : UnitComponent +{ + + public override void Initialize() + { + base.Initialize(); + } + + + +}
\ No newline at end of file diff --git a/Assets/Scripts/Unit/Components/UnitPostEffect.cs.meta b/Assets/Scripts/Unit/Components/UnitPostEffect.cs.meta new file mode 100644 index 00000000..d91936b9 --- /dev/null +++ b/Assets/Scripts/Unit/Components/UnitPostEffect.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a7d49a2074b33d342beb20900188941d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Unit/Components/UnitRender.cs b/Assets/Scripts/Unit/Components/UnitRender.cs index d1ea0ffb..a5822ffe 100644 --- a/Assets/Scripts/Unit/Components/UnitRender.cs +++ b/Assets/Scripts/Unit/Components/UnitRender.cs @@ -6,6 +6,7 @@ using UnityEngine; [DisallowMultipleComponent] public class UnitRender : UnitComponent { + public IBodyRendererAgent body { get { return m_Body; } } private IBodyRendererAgent m_Body; public Renderer mainRenderer
@@ -34,13 +35,13 @@ public class UnitRender : UnitComponent LayerMask mask = LayerMask.GetMask("PlayerCharacter");
if (!isVisible)
{
- SceneManager.Instance.mainCamera.cullingMask &= ~mask.value;
+ //SceneManager.Instance.mainCamera.cullingMask &= ~mask.value;
}
else
{
- SceneManager.Instance.mainCamera.cullingMask |= mask.value;
- }
- } + //SceneManager.Instance.mainCamera.cullingMask |= mask.value;
+ }
+ } public void SetVisibilityInAllCameras(bool isVisible)
{
@@ -49,12 +50,12 @@ public class UnitRender : UnitComponent if (isVisible)
{
- mainRenderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On;
- }
- else
+ //mainRenderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On;
+ }
+ else
{
- mainRenderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.ShadowsOnly;
- }
- } + //mainRenderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.ShadowsOnly;
+ }
+ } -} +}
diff --git a/Assets/Scripts/Unit/Controller/PCController.cs b/Assets/Scripts/Unit/Controller/PCController.cs index 4c665e7a..90520017 100644 --- a/Assets/Scripts/Unit/Controller/PCController.cs +++ b/Assets/Scripts/Unit/Controller/PCController.cs @@ -8,11 +8,13 @@ public class PCController : UnitController {
public static PCController instance;
- public UnitAfterImage unitAfterImage;
-
+ #region Unit的三种效果
+ public UnitAfterImage unitAfterImage;
public UnitImageEffect unitImageEffect;
+ public UnitLensEffect unitLensEffect;
+ #endregion
- public override UnitType type { get { return UnitType.PC; } }
+ public override UnitType type { get { return UnitType.PC; } }
private void Awake()
{
@@ -34,7 +36,11 @@ public class PCController : UnitController unitImageEffect = GetOrAddUnitComponent<UnitImageEffect>();
unitImageEffect.Initialize();
- }
+
+ unitLensEffect = GetOrAddUnitComponent<UnitLensEffect>();
+ unitLensEffect.Initialize();
+
+ }
public override void Update()
{
diff --git a/Assets/Scripts/Unit/LensEffect.meta b/Assets/Scripts/Unit/LensEffect.meta new file mode 100644 index 00000000..ad9ac741 --- /dev/null +++ b/Assets/Scripts/Unit/LensEffect.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3d1f1847b55e52a448151b0186678736 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Unit/LensEffect/RendererProxy.cs b/Assets/Scripts/Unit/LensEffect/RendererProxy.cs new file mode 100644 index 00000000..17d8d611 --- /dev/null +++ b/Assets/Scripts/Unit/LensEffect/RendererProxy.cs @@ -0,0 +1,33 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[RequireComponent(typeof(Renderer))] +public class RendererProxy : MonoBehaviour +{ + public delegate void OnWillRenderObjectHandler(BodyPartRenderer renderer); + public OnWillRenderObjectHandler onWillRenderObject; + + public delegate void OnRenderObjectHandler(BodyPartRenderer renderer); + public OnRenderObjectHandler onRenderObject; + + BodyPartRenderer bodyPartRenderer; + + public void Initialize(BodyPartRenderer renderer) + { + bodyPartRenderer = renderer; + } + + void OnWillRenderObject() + { + if(onWillRenderObject != null) + onWillRenderObject(bodyPartRenderer); + } + + void OnRenderObject() + { + if(onRenderObject != null) + onRenderObject(bodyPartRenderer); + } + +} diff --git a/Assets/Scripts/Unit/LensEffect/RendererProxy.cs.meta b/Assets/Scripts/Unit/LensEffect/RendererProxy.cs.meta new file mode 100644 index 00000000..5f8c904e --- /dev/null +++ b/Assets/Scripts/Unit/LensEffect/RendererProxy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 81836ced17364c94d8130f6eeb2bf115 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Unit/TimelineEventProxy.cs b/Assets/Scripts/Unit/TimelineEventProxy.cs index 9e41e30e..866c6d3b 100644 --- a/Assets/Scripts/Unit/TimelineEventProxy.cs +++ b/Assets/Scripts/Unit/TimelineEventProxy.cs @@ -51,8 +51,14 @@ public partial class TimelineEventProxy EventGame_TimeScale, // 缩放时间
EventMesh_ImageEffect_MotionBlur, // 运动模糊 - EventMesh_ImageEffect_Glitch, // glitch - EventMesh_AfterImage, // 角色残像
+ EventMesh_ImageEffect_Glitch, // glitch
+
+ EventMesh_LensEffect_Bloom, // bloom
+ EventMesh_LensEffect_MotionBlur, // motionBlur
+
+ EventMesh_PostEffect_Curly, //
+
+ EventMesh_AfterImage, // 角色残像
EventMesh_AfterImageStop, // 角色残像停止事件
EventMesh_FadeIn, // 角色透明度
EventMesh_FadeOut, // 角色透明度 diff --git a/Assets/Scripts/Unit/UnitDetail.cs b/Assets/Scripts/Unit/UnitDetail.cs index 3f7f23e9..09eefa51 100644 --- a/Assets/Scripts/Unit/UnitDetail.cs +++ b/Assets/Scripts/Unit/UnitDetail.cs @@ -125,8 +125,8 @@ public class BodyPartRenderer public interface IBodyRendererAgent
{
- BodyPartRenderer mainRenderer { get; }
- BodyPartRenderer[] renderers{ get; }
+ BodyPartRenderer mainRenderer { get; }
+ BodyPartRenderer[] renderers { get; }
} public interface IBodyJointAgent
@@ -142,7 +142,10 @@ public interface IBodyJointAgent [DisallowMultipleComponent] public class UnitDetail : MonoBehaviour, IBodyRendererAgent, IBodyJointAgent { - public bool showGizmos; + public bool showGizmos;
+
+ [FormerlySerializedAs("root")] + public Transform rootBone; [Tooltip("残影用的prefab")] public string afterImageAvatarPath;
diff --git a/Assets/Scripts/Utils/MatrixUtility.cs b/Assets/Scripts/Utils/MatrixUtility.cs new file mode 100644 index 00000000..f3d865f2 --- /dev/null +++ b/Assets/Scripts/Utils/MatrixUtility.cs @@ -0,0 +1,42 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public static class MatrixUtility +{ + + public static void SetTR(ref this Matrix4x4 matrix, Vector3 pos, Quaternion q) + { + matrix = q.ToMatrix(); + matrix[12] = pos[0]; + matrix[13] = pos[1]; + matrix[14] = pos[2]; + } + + public static void SetTRS2(ref this Matrix4x4 matrix, Vector3 pos, Quaternion q, Vector3 s) + { + matrix = q.ToMatrix(); + + matrix[0] *= s[0]; + matrix[1] *= s[0]; + matrix[2] *= s[0]; + matrix[4] *= s[1]; + matrix[5] *= s[1]; + matrix[6] *= s[1]; + matrix[8] *= s[2]; + matrix[9] *= s[2]; + matrix[10] *= s[2]; + matrix[12] = pos[0]; + matrix[13] = pos[1]; + matrix[14] = pos[2]; + + } + + public static Matrix4x4 RotateAndTranslate(Vector3 pos, Quaternion q) + { + Matrix4x4 m = new Matrix4x4(); + m.SetTR(pos, q); + return m; + } + +} diff --git a/Assets/Scripts/Utils/MatrixUtility.cs.meta b/Assets/Scripts/Utils/MatrixUtility.cs.meta new file mode 100644 index 00000000..746a5d82 --- /dev/null +++ b/Assets/Scripts/Utils/MatrixUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f4a4958b670de143b1189fc304ace4a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Utils/QuaternionUtility.cs b/Assets/Scripts/Utils/QuaternionUtility.cs new file mode 100644 index 00000000..d491b1fe --- /dev/null +++ b/Assets/Scripts/Utils/QuaternionUtility.cs @@ -0,0 +1,51 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public static class QuaternionUtility +{ + + public static Matrix4x4 ToMatrix(ref this Quaternion q) + { + Matrix4x4 m = new Matrix4x4(); + + // Precalculate coordinate products + float x = q.x * 2.0F; + float y = q.y * 2.0F; + float z = q.z * 2.0F; + float xx = q.x * x; + float yy = q.y * y; + float zz = q.z * z; + float xy = q.x * y; + float xz = q.x * z; + float yz = q.y * z; + float wx = q.w * x; + float wy = q.w * y; + float wz = q.w * z; + + // Calculate 3x3 matrix from orthonormal basis + m[0] = 1.0f - (yy + zz); + m[1] = xy + wz; + m[2] = xz - wy; + m[3] = 0.0F; + + m[4] = xy - wz; + m[5] = 1.0f - (xx + zz); + m[6] = yz + wx; + m[7] = 0.0F; + + m[8] = xz + wy; + m[9] = yz - wx; + m[10] = 1.0f - (xx + yy); + m[11] = 0.0F; + + m[12] = 0.0F; + m[13] = 0.0F; + m[14] = 0.0F; + m[15] = 1.0F; + + return m; + } + + +} diff --git a/Assets/Scripts/Utils/QuaternionUtility.cs.meta b/Assets/Scripts/Utils/QuaternionUtility.cs.meta new file mode 100644 index 00000000..49d589fc --- /dev/null +++ b/Assets/Scripts/Utils/QuaternionUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 789820cb2898f6f488d8b3bfdf94ab00 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Utils/TransformUtility.cs b/Assets/Scripts/Utils/TransformUtility.cs new file mode 100644 index 00000000..62a28ece --- /dev/null +++ b/Assets/Scripts/Utils/TransformUtility.cs @@ -0,0 +1,54 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public static class TransformUtility +{ + + public static Matrix4x4 GetLocalToWorldMatrix(Transform transform) + { + Matrix4x4 mat = Matrix4x4.identity; + while(transform != null) + { + Matrix4x4 m = Matrix4x4.identity; + m.SetTRS2(transform.localPosition, transform.localRotation, transform.localScale); + mat = m * mat; + transform = transform.parent; + } + + return mat; + } + + public static Matrix4x4 GetLocalToWorldMatrixNoScale(Transform transform) + { + Matrix4x4 mat = Matrix4x4.identity; + while (transform != null) + { + Matrix4x4 m = Matrix4x4.identity; + m.SetTR(transform.localPosition, transform.localRotation); + mat = m * mat; + transform = transform.parent; + } + + return mat; + } + + public static Matrix4x4 GetLocalToWorldMatrixRootBone(Transform transform) + { + //Matrix4x4 mat = Matrix4x4.identity; + //while (transform != null) + //{ + // Matrix4x4 m = Matrix4x4.identity; + // m = Matrix4x4.Rotate(transform.localRotation); + // mat = m * mat; + // transform = transform.parent; + //} + //mat.SetColumn(3, new Vector4(trans.position.x, trans.position.y, trans.position.z, 1)); + + Matrix4x4 mat = Matrix4x4.Rotate(transform.rotation); + mat.SetColumn(3, new Vector4(transform.position.x, transform.position.y, transform.position.z, 1)); + + return mat; + } + +}
\ No newline at end of file diff --git a/Assets/Scripts/Utils/TransformUtility.cs.meta b/Assets/Scripts/Utils/TransformUtility.cs.meta new file mode 100644 index 00000000..bda7ca18 --- /dev/null +++ b/Assets/Scripts/Utils/TransformUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 00b07ec5a54ffcc44a9af249df119257 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/VRMShaders/MToon/MToon/Resources/Shaders/MToon.shader b/Assets/ThirdParty/VRM/VRMShaders/MToon/MToon/Resources/Shaders/MToon.shader index dafcf557..e17346f0 100644 --- a/Assets/ThirdParty/VRM/VRMShaders/MToon/MToon/Resources/Shaders/MToon.shader +++ b/Assets/ThirdParty/VRM/VRMShaders/MToon/MToon/Resources/Shaders/MToon.shader @@ -51,7 +51,7 @@ Shader "VRM/MToon" // for SM 3.0 SubShader { - Tags { "RenderType" = "Opaque" /* "Queue" = "Geometry" */ "Queue"="Transparent"} + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" } // Forward Base Pass @@ -139,8 +139,8 @@ Shader "VRM/MToon" #pragma multi_compile_fog ENDCG } - - // Shadow rendering pass + // + //// Shadow rendering pass Pass { Name "ShadowCaster" @@ -159,6 +159,38 @@ Shader "VRM/MToon" #include "UnityStandardShadow.cginc" ENDCG } + + // shadow caster rendering pass, implemented manually + // using macros from UnityCG.cginc + //Pass + //{ + // Name "ShadowCaster" + // Tags {"LightMode" = "ShadowCaster"} + + // CGPROGRAM + // #pragma vertex vert + // #pragma fragment frag + // #pragma multi_compile_shadowcaster + // #include "UnityCG.cginc" + + // struct v2f { + // V2F_SHADOW_CASTER; + // }; + + // v2f vert(appdata_base v) + // { + // v2f o; + // TRANSFER_SHADOW_CASTER_NORMALOFFSET(o) + // return o; + // } + + // float4 frag(v2f i) : SV_Target + // { + // SHADOW_CASTER_FRAGMENT(i) + // } + // ENDCG + //} + } Fallback "Unlit/Texture" |