summaryrefslogtreecommitdiff
path: root/Assets
diff options
context:
space:
mode:
Diffstat (limited to 'Assets')
-rw-r--r--Assets/Art/Vfx/GrabSquaresEffect/Shaders.meta8
-rw-r--r--Assets/Bundle/Materials/Common.meta (renamed from Assets/Art/Models/Characters/Default.meta)2
-rw-r--r--Assets/Bundle/Materials/Common/Image.meta (renamed from Assets/Art/Models/Characters/Erika2.meta)2
-rw-r--r--Assets/Bundle/Materials/Common/Image/common_img_buzz.mat77
-rw-r--r--Assets/Bundle/Materials/Common/Image/common_img_buzz.mat.meta8
-rw-r--r--Assets/Bundle/Materials/Unit/Common.meta (renamed from Assets/Art/Vfx/GrabSquaresEffect/AbstractWiresEffect/Scripts.meta)2
-rw-r--r--Assets/Bundle/Models.meta8
-rw-r--r--Assets/Bundle/Prefabs.meta8
-rw-r--r--Assets/Bundle/Scenes/Demo/AnimationEditScene.unity97
-rw-r--r--Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs18
-rw-r--r--Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader75
-rw-r--r--Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader.meta9
-rw-r--r--Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader6
-rw-r--r--Assets/Bundle/Shaders/Unit/Common.meta (renamed from Assets/Art/Vfx/GrabSquaresEffect/Scripts.meta)2
-rw-r--r--Assets/Bundle/Shaders/Unit/Common/unit_common_depth.shader64
-rw-r--r--Assets/Bundle/Shaders/Unit/Common/unit_common_depth.shader.meta9
-rw-r--r--Assets/Bundle/Shaders/Unit/Effect.meta8
-rw-r--r--Assets/Bundle/UI.meta8
-rw-r--r--Assets/Bundle/Unit/Monster/Robots_Prowler/ActionData.meta8
-rw-r--r--Assets/Bundle/Unit/Monster/Robots_Prowler/UnitData.meta8
-rw-r--r--Assets/Bundle/Unit/NPC.meta8
-rw-r--r--Assets/Bundle/Unit/PC/Erika/Materials/Effect.meta (renamed from Assets/Bundle/Materials/Unit/Effect.meta)2
-rw-r--r--Assets/Bundle/Unit/PC/Erika/Materials/Normal.meta8
-rw-r--r--Assets/Bundle/Unit/PC/Erika/Models.meta8
-rw-r--r--Assets/Bundle/Unit/PC/Erika/UnitData.meta8
-rw-r--r--Assets/Bundle/Unit/PC/Erika/Weapons/Materials.meta8
-rw-r--r--Assets/Bundle/Unit/PC/ErikaCyborg/ActionData.meta8
-rw-r--r--Assets/Bundle/Unit/PC/ErikaCyborg/AnimationClip.meta8
-rw-r--r--Assets/Bundle/Unit/PC/ErikaCyborg/AnimationData.meta8
-rw-r--r--Assets/Bundle/Unit/PC/ErikaCyborg/Materials/AfterImage.meta8
-rw-r--r--Assets/Bundle/Unit/PC/ErikaCyborg/Materials/Normal.meta8
-rw-r--r--Assets/Bundle/Unit/PC/ErikaCyborg/Models.meta8
-rw-r--r--Assets/Bundle/Unit/PC/ErikaCyborg/RootMotion.meta8
-rw-r--r--Assets/Bundle/Unit/PC/ErikaCyborg/UnitData.meta8
-rw-r--r--Assets/Bundle/Unit/PC/ErikaCyborg/Weapons.meta8
-rw-r--r--Assets/Bundle/Unit/Prop.meta8
-rw-r--r--Assets/Data/RootMotionData.meta8
-rw-r--r--Assets/Scripts/Curve3D.meta8
-rw-r--r--Assets/Scripts/Data/EnumDefine.cs3
-rw-r--r--Assets/Scripts/Data/StaticDefine.cs2
-rw-r--r--Assets/Scripts/Drone.meta8
-rw-r--r--Assets/Scripts/Managers/Physics.meta8
-rw-r--r--Assets/Scripts/Managers/UnitManager.cs2
-rw-r--r--Assets/Scripts/Props.meta8
-rw-r--r--Assets/Scripts/Robot.meta8
-rw-r--r--Assets/Scripts/Scene.meta8
-rw-r--r--Assets/Scripts/Unit/AI/Actions.meta8
-rw-r--r--Assets/Scripts/Unit/AI/Conditionals.meta8
-rw-r--r--Assets/Scripts/Unit/Components/UnitLensEffect.cs17
-rw-r--r--Assets/Scripts/Unit/Components/UnitPreprocessing.cs128
-rw-r--r--Assets/Scripts/Unit/Components/UnitPreprocessing.cs.meta (renamed from Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs.meta)2
-rw-r--r--Assets/Scripts/Unit/Controller/PCController.cs7
-rw-r--r--Assets/Scripts/Unit/Controller/UnitController.cs7
-rw-r--r--Assets/Scripts/Unit/LensEffect/LensEffect_Buzz.cs41
-rw-r--r--Assets/Scripts/Unit/LensEffect/LensEffect_Buzz.cs.meta11
-rw-r--r--Assets/Scripts/Unit/LensEffect/LensEffect_Dash.cs3
56 files changed, 479 insertions, 365 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/Art/Models/Characters/Erika2.meta b/Assets/Bundle/Materials/Common/Image.meta
index fd7369d9..9779c86b 100644
--- a/Assets/Art/Models/Characters/Erika2.meta
+++ b/Assets/Bundle/Materials/Common/Image.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 077f81003f9fc564791cce182048c2b0
+guid: 15590202ba38eca4ba923103229c400f
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Assets/Bundle/Materials/Common/Image/common_img_buzz.mat b/Assets/Bundle/Materials/Common/Image/common_img_buzz.mat
new file mode 100644
index 00000000..30c5865a
--- /dev/null
+++ b/Assets/Bundle/Materials/Common/Image/common_img_buzz.mat
@@ -0,0 +1,77 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+ serializedVersion: 6
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_Name: common_img_buzz
+ m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
+ m_ShaderKeywords:
+ m_LightmapFlags: 4
+ m_EnableInstancingVariants: 0
+ m_DoubleSidedGI: 0
+ m_CustomRenderQueue: -1
+ stringTagMap: {}
+ disabledShaderPasses: []
+ m_SavedProperties:
+ serializedVersion: 3
+ m_TexEnvs:
+ - _BumpMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _DetailAlbedoMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _DetailMask:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _DetailNormalMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _EmissionMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _MainTex:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _MetallicGlossMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _OcclusionMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _ParallaxMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ m_Floats:
+ - _BumpScale: 1
+ - _Cutoff: 0.5
+ - _DetailNormalMapScale: 1
+ - _DstBlend: 0
+ - _GlossMapScale: 1
+ - _Glossiness: 0.5
+ - _GlossyReflections: 1
+ - _Metallic: 0
+ - _Mode: 0
+ - _OcclusionStrength: 1
+ - _Parallax: 0.02
+ - _SmoothnessTextureChannel: 0
+ - _SpecularHighlights: 1
+ - _SrcBlend: 1
+ - _UVSec: 0
+ - _ZWrite: 1
+ m_Colors:
+ - _Color: {r: 1, g: 1, b: 1, a: 1}
+ - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
diff --git a/Assets/Bundle/Materials/Common/Image/common_img_buzz.mat.meta b/Assets/Bundle/Materials/Common/Image/common_img_buzz.mat.meta
new file mode 100644
index 00000000..55472497
--- /dev/null
+++ b/Assets/Bundle/Materials/Common/Image/common_img_buzz.mat.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: cc5ddc824aedf10408dc62b265f8dc26
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 2100000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Art/Vfx/GrabSquaresEffect/AbstractWiresEffect/Scripts.meta b/Assets/Bundle/Materials/Unit/Common.meta
index b76e98a5..c93b1f88 100644
--- a/Assets/Art/Vfx/GrabSquaresEffect/AbstractWiresEffect/Scripts.meta
+++ b/Assets/Bundle/Materials/Unit/Common.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 20381b3eecfbfe34a9d9222868969d29
+guid: f56fd8c608849b44b9364a3469655444
folderAsset: yes
DefaultImporter:
externalObjects: {}
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 2411e846..3341759e 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:
@@ -57576,101 +57576,6 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
---- !u!1001 &585978178
-PrefabInstance:
- m_ObjectHideFlags: 0
- serializedVersion: 2
- m_Modification:
- m_TransformParent: {fileID: 0}
- m_Modifications:
- - target: {fileID: 6928033330946439154, guid: 24a1c73fccb426e4f962d12c92993aac,
- type: 3}
- propertyPath: m_Name
- value: Erika_Robot_Snapshot
- objectReference: {fileID: 0}
- - target: {fileID: 6930345995811640846, guid: 24a1c73fccb426e4f962d12c92993aac,
- type: 3}
- propertyPath: m_LocalPosition.x
- value: 3.54
- objectReference: {fileID: 0}
- - target: {fileID: 6930345995811640846, guid: 24a1c73fccb426e4f962d12c92993aac,
- type: 3}
- propertyPath: m_LocalPosition.y
- value: 3.34
- objectReference: {fileID: 0}
- - target: {fileID: 6930345995811640846, guid: 24a1c73fccb426e4f962d12c92993aac,
- type: 3}
- propertyPath: m_LocalPosition.z
- value: -12.52
- objectReference: {fileID: 0}
- - target: {fileID: 6930345995811640846, guid: 24a1c73fccb426e4f962d12c92993aac,
- type: 3}
- propertyPath: m_LocalRotation.x
- value: 0
- objectReference: {fileID: 0}
- - target: {fileID: 6930345995811640846, guid: 24a1c73fccb426e4f962d12c92993aac,
- type: 3}
- propertyPath: m_LocalRotation.y
- value: 0
- objectReference: {fileID: 0}
- - target: {fileID: 6930345995811640846, guid: 24a1c73fccb426e4f962d12c92993aac,
- type: 3}
- propertyPath: m_LocalRotation.z
- value: 0
- objectReference: {fileID: 0}
- - target: {fileID: 6930345995811640846, guid: 24a1c73fccb426e4f962d12c92993aac,
- type: 3}
- propertyPath: m_LocalRotation.w
- value: 1
- objectReference: {fileID: 0}
- - target: {fileID: 6930345995811640846, guid: 24a1c73fccb426e4f962d12c92993aac,
- type: 3}
- propertyPath: m_RootOrder
- value: 11
- objectReference: {fileID: 0}
- - target: {fileID: 6930345995811640846, guid: 24a1c73fccb426e4f962d12c92993aac,
- type: 3}
- propertyPath: m_LocalEulerAnglesHint.x
- value: 0
- objectReference: {fileID: 0}
- - target: {fileID: 6930345995811640846, guid: 24a1c73fccb426e4f962d12c92993aac,
- type: 3}
- propertyPath: m_LocalEulerAnglesHint.y
- value: 0
- objectReference: {fileID: 0}
- - target: {fileID: 6930345995811640846, guid: 24a1c73fccb426e4f962d12c92993aac,
- type: 3}
- propertyPath: m_LocalEulerAnglesHint.z
- value: 0
- objectReference: {fileID: 0}
- m_RemovedComponents:
- - {fileID: 5696818452860696233, guid: 24a1c73fccb426e4f962d12c92993aac, type: 3}
- m_SourcePrefab: {fileID: 100100000, guid: 24a1c73fccb426e4f962d12c92993aac, type: 3}
---- !u!1 &585978179 stripped
-GameObject:
- m_CorrespondingSourceObject: {fileID: 6928033330946439154, guid: 24a1c73fccb426e4f962d12c92993aac,
- type: 3}
- m_PrefabInstance: {fileID: 585978178}
- m_PrefabAsset: {fileID: 0}
---- !u!95 &585978180 stripped
-Animator:
- m_CorrespondingSourceObject: {fileID: 7023111129766813114, guid: 24a1c73fccb426e4f962d12c92993aac,
- type: 3}
- m_PrefabInstance: {fileID: 585978178}
- m_PrefabAsset: {fileID: 0}
---- !u!114 &585978181
-MonoBehaviour:
- m_ObjectHideFlags: 0
- m_CorrespondingSourceObject: {fileID: 0}
- m_PrefabInstance: {fileID: 0}
- m_PrefabAsset: {fileID: 0}
- m_GameObject: {fileID: 585978179}
- m_Enabled: 1
- m_EditorHideFlags: 0
- m_Script: {fileID: 11500000, guid: d63b30ef896f0a548865db54d2bdbbeb, type: 3}
- m_Name:
- m_EditorClassIdentifier:
- animator: {fileID: 585978180}
--- !u!1 &659412353
GameObject:
m_ObjectHideFlags: 0
diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs b/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs
deleted file mode 100644
index a5603324..00000000
--- a/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-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_buzz.shader b/Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader
new file mode 100644
index 00000000..467733f9
--- /dev/null
+++ b/Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader
@@ -0,0 +1,75 @@
+// 蜂鸣
+
+Shader "Erika/Common/Image/Buzz"
+{
+ Properties
+ {
+ _MainTex("Texture", 2D) = "white" {}
+ _TileOffset("TileOffset", Vector) = (1,1,0,0)
+ }
+
+ SubShader
+ {
+ Tags { "RenderType" = "Opaque" "Queue" = "Transparent-1"}
+ LOD 100
+
+ ZWrite Off
+ ZTest LEqual
+
+ Blend One Zero
+
+ Pass
+ {
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+
+ #include "UnityCG.cginc"
+
+ #include "Assets/Bundle/Shaders/Include/ImageEffect.cginc"
+
+ struct v2f
+ {
+ float2 uv : TEXCOORD0;
+ float4 vertex : SV_POSITION;
+ };
+
+ sampler2D _MainTex;
+ float4 _MainTex_ST;
+
+ sampler2D _CameraDepthTexture;
+ float4 _CameraDepthTexture_ST;
+
+ sampler2D _UnitDepthTexture;
+ float4 _UnitDepthTexture_ST;
+
+ float4 _TileOffset; // 角色的范围
+
+ v2f vert(appdata_img v)
+ {
+ v2f o;
+ o.vertex = UnityObjectToClipPos(v.vertex);
+ o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
+ return o;
+ }
+
+ fixed4 frag(v2f i) : SV_Target
+ {
+ fixed2 uv = i.uv;
+ float depth0 = tex2D(_CameraDepthTexture, uv).r;
+ float depth1 = tex2D(_UnitDepthTexture, uv).r;
+
+ fixed4 color = tex2D(_MainTex, uv);
+
+ if (abs(depth0 - depth1) < 0.001f && depth1 != 1)
+ {
+ color.r = 1;
+ }
+
+ return color;
+ }
+ ENDCG
+ }
+ }
+
+} // shader
diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader.meta b/Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader.meta
new file mode 100644
index 00000000..310221ef
--- /dev/null
+++ b/Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 506516fea7a699443b904c0221d860f7
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader b/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader
index 6219bdac..418d7347 100644
--- a/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader
+++ b/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader
@@ -1,4 +1,4 @@
-// 高斯模糊
+// 动态模糊
Shader "Erika/Common/Image/MotionBlur"
{
@@ -64,16 +64,16 @@ Shader "Erika/Common/Image/MotionBlur"
fixed2 uv0 = i.uv;
- //fixed4 color = blur(_MainTex, _ScreenParams.xy, uv);
fixed4 color = fixed4(0,0,0,0);
const float count = 20;
float step = _Distance / count;
+ float amount = 0.15;
for(int i = 0; i < count; ++i)
{
fixed2 uv = uv0 + step * i * fixed2(cos(radians(_Angle)), sin(radians(_Angle)));
if(uv.x > 1) continue;
if(uv.x < 0) continue;
- float weight = 0.15 - 0.15 * ((float)i / (float)count);
+ float weight = amount - amount * ((float)i / (float)count);
color += tex2D(_MainTex, uv) * weight;
}
diff --git a/Assets/Art/Vfx/GrabSquaresEffect/Scripts.meta b/Assets/Bundle/Shaders/Unit/Common.meta
index 41200932..0f29291c 100644
--- a/Assets/Art/Vfx/GrabSquaresEffect/Scripts.meta
+++ b/Assets/Bundle/Shaders/Unit/Common.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: abff7cb61c760094f8ab9437379e0f2c
+guid: 2873cd4cc2d0bfa4bbb17ad11144a488
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Assets/Bundle/Shaders/Unit/Common/unit_common_depth.shader b/Assets/Bundle/Shaders/Unit/Common/unit_common_depth.shader
new file mode 100644
index 00000000..075aec39
--- /dev/null
+++ b/Assets/Bundle/Shaders/Unit/Common/unit_common_depth.shader
@@ -0,0 +1,64 @@
+Shader "Erika/Unit/Common/Depth"
+{
+ Properties
+ {
+ _MainTex ("Texture", 2D) = "white" {}
+ }
+ SubShader
+ {
+ Tags { "RenderType" = "Opaque" "Queue" = "Geometry" }
+ LOD 100
+/*
+ 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
+
+ }*/
+
+ Pass
+ {
+ Name "ShadowCaster"
+ Tags { "LightMode" = "ShadowCaster" }
+
+ Cull Back
+ ZWrite On
+ ZTest LEqual
+
+ CGPROGRAM
+ #pragma target 3.0
+ #pragma multi_compile _ _ALPHATEST_ON _ALPHABLEND_ON
+ #pragma multi_compile_shadowcaster
+ #pragma vertex vertShadowCaster
+ #pragma fragment fragShadowCaster
+ #include "UnityStandardShadow.cginc"
+ ENDCG
+ }
+
+ }
+}
diff --git a/Assets/Bundle/Shaders/Unit/Common/unit_common_depth.shader.meta b/Assets/Bundle/Shaders/Unit/Common/unit_common_depth.shader.meta
new file mode 100644
index 00000000..0de1fc19
--- /dev/null
+++ b/Assets/Bundle/Shaders/Unit/Common/unit_common_depth.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: ff6fd35dfc3c1104c875126ac78274b6
+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/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/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/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/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/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/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
index decba9c5..50e0baf5 100644
--- a/Assets/Scripts/Data/EnumDefine.cs
+++ b/Assets/Scripts/Data/EnumDefine.cs
@@ -15,8 +15,11 @@ public enum EShader
{
Blur,
MotionBlur,
+ Buzz,
SolidColor,
+ UnitDepth,
+
}
diff --git a/Assets/Scripts/Data/StaticDefine.cs b/Assets/Scripts/Data/StaticDefine.cs
index ca05d947..ae06f364 100644
--- a/Assets/Scripts/Data/StaticDefine.cs
+++ b/Assets/Scripts/Data/StaticDefine.cs
@@ -21,6 +21,8 @@ public static class StaticDefine
{ EShader.Blur, new ShaderDefine("Erika/Common/Image/Blur", "")},
{ EShader.MotionBlur, new ShaderDefine("Erika/Common/Image/MotionBlur", "")},
{ EShader.SolidColor, new ShaderDefine("Erika/Common/SolidColor", "") },
+ { EShader.UnitDepth, new ShaderDefine("Erika/Unit/Common/Depth", "") },
+ { EShader.Buzz, new ShaderDefine("Erika/Common/Image/Buzz", "") },
};
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/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/Managers/UnitManager.cs b/Assets/Scripts/Managers/UnitManager.cs
index 6196e892..920cbe9e 100644
--- a/Assets/Scripts/Managers/UnitManager.cs
+++ b/Assets/Scripts/Managers/UnitManager.cs
@@ -26,7 +26,7 @@ public class UnitManager : Singleton<UnitManager>
{
List<UnitSnapshot> snapshots;
UnitSnapshot snap = null;
- if (m_Snapshots.TryGetValue(unit, out snapshots))
+ if (m_Snapshots.TryGetValue(unit, out snapshots) && snapshots.Count > 0)
{
snap = snapshots[snapshots.Count - 1];
snapshots.RemoveAt(snapshots.Count - 1);
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.meta b/Assets/Scripts/Scene.meta
new file mode 100644
index 00000000..eb7a8716
--- /dev/null
+++ b/Assets/Scripts/Scene.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: eaee2d0f48cff9b40baf0686a8105600
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
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/UnitLensEffect.cs b/Assets/Scripts/Unit/Components/UnitLensEffect.cs
index a3c5d2c8..ef8e6ee6 100644
--- a/Assets/Scripts/Unit/Components/UnitLensEffect.cs
+++ b/Assets/Scripts/Unit/Components/UnitLensEffect.cs
@@ -60,19 +60,20 @@ public class UnitLensEffect : UnitComponent
}
MainCamera.Instance.customRenderingPipeline.onPreCull += OnWillRenderUnit;
- MainCamera.Instance.customRenderingPipeline.onPostRender += OnRenderUnit;
-
- /////
+ MainCamera.Instance.customRenderingPipeline.onPostRender += OnRenderUnit;
+
+ /////
//m_Effects.Add(new LensEffect_MotionBlur());
- //m_Effects.Add(new LensEffect_BlurRim(Color.blue));
+ //m_Effects.Add(new LensEffect_BlurRim(Color.blue));
+ m_Effects.Add(new LensEffect_Buzz());
}
public override void Release()
- {
- base.Release();
-
- MainCamera.Instance.customRenderingPipeline.onPreRender -= OnWillRenderUnit;
+ {
+ MainCamera.Instance.customRenderingPipeline.onPreCull -= OnWillRenderUnit;
MainCamera.Instance.customRenderingPipeline.onPostRender -= OnRenderUnit;
+
+ base.Release();
}
private void OnWillRenderUnit()
diff --git a/Assets/Scripts/Unit/Components/UnitPreprocessing.cs b/Assets/Scripts/Unit/Components/UnitPreprocessing.cs
new file mode 100644
index 00000000..30357615
--- /dev/null
+++ b/Assets/Scripts/Unit/Components/UnitPreprocessing.cs
@@ -0,0 +1,128 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Rendering;
+
+// 给每个角色准备一些特殊的前置渲染
+public class UnitPreprocessing : UnitComponent
+{
+ [Flags]
+ public enum EUnitPreprocessing
+ {
+ None ,
+ DepthTexture, // Unit Depth Texture
+ WorldNormalTexture, // Unit World Normal Texture
+ }
+
+ public EUnitPreprocessing preprocessing;
+
+ public RenderTexture unitDepthTexture { get; private set; }
+ public RenderTexture unitWorldNormalTexture { get; private set; }
+
+ private CommandBuffer m_CBBeforeDepthTexture;
+
+ private Material m_MaterialDepth;
+
+ public override void Initialize()
+ {
+ base.Initialize();
+ }
+
+ public override void OnPostInitialize()
+ {
+ base.OnPostInitialize();
+
+ MainCamera.Instance.customRenderingPipeline.onPreCull += OnWillRenderUnit;
+ MainCamera.Instance.customRenderingPipeline.onPostRender += OnRenderUnit;
+
+ m_CBBeforeDepthTexture = new CommandBuffer();
+
+ PrepareRenderTextures();
+ PrepareMaterials();
+ }
+
+ void PrepareRenderTextures()
+ {
+ int unitHash = owner.GetHashCode();
+
+ int width = MainCamera.Instance.camera.pixelWidth;
+ int height = MainCamera.Instance.camera.pixelHeight;
+ unitDepthTexture = new RenderTexture(width, height, 24, RenderTextureFormat.Depth, RenderTextureReadWrite.Linear);
+ unitDepthTexture.name = "UnitDepthTexture_" + owner.GetHashCode();
+ }
+
+ void PrepareMaterials()
+ {
+ m_MaterialDepth = new Material(Shader.Find(StaticDefine.shaders[EShader.UnitDepth].name));
+ }
+
+ public override void OnUpdate()
+ {
+ base.OnUpdate();
+ }
+
+ public override void Release()
+ {
+ MainCamera.Instance.customRenderingPipeline.onPreCull -= OnWillRenderUnit;
+ MainCamera.Instance.customRenderingPipeline.onPostRender -= OnRenderUnit;
+
+ base.Release();
+ }
+
+ private void OnWillRenderUnit()
+ {
+ RenderDepthTexture();
+ //RenderWorldNormal();
+
+ MainCamera.Instance.camera.AddCommandBuffer(CameraEvent.BeforeDepthTexture, m_CBBeforeDepthTexture);
+ }
+
+ void RenderDepthTexture()
+ {
+ var cb = m_CBBeforeDepthTexture;
+ cb.Clear();
+ cb.SetRenderTarget(unitDepthTexture);
+ cb.ClearRenderTarget(true, true, new Color(0, 0, 0, 0));
+
+ cb.SetGlobalVector("unity_LightShadowBias", Vector4.zero);
+
+ foreach (var r in GetRenderers())
+ {
+ BodyPartRenderer br = r as BodyPartRenderer;
+ if (br == null)
+ continue;
+ Renderer renderer = br.renderer as Renderer;
+ if (renderer == null)
+ continue;
+ cb.DrawRenderer(renderer, m_MaterialDepth);
+ }
+ }
+
+ //void RenderWorldNormal()
+ //{
+ // var cb = m_CBBeforeDepthTexture;
+ // cb.Clear();
+ // cb.GetTemporaryRT(unitWorldNormalTextureID, -1, -1, 24, FilterMode.Point, RenderTextureFormat.RG16, RenderTextureReadWrite.Linear);
+ // cb.SetRenderTarget(unitWorldNormalTextureID);
+ // cb.ClearRenderTarget(true, true, new Color(0, 0, 0, 0));
+ //}
+
+ IEnumerable GetRenderers()
+ {
+ IBodyRendererAgent body = owner.unitRender.body;
+ if (body == null || body.renderers == null || body.renderers.Length == 0)
+ yield break;
+ for (int j = 0; j < body.renderers.Length; ++j)
+ {
+ yield return body.renderers[j];
+ }
+ }
+
+ private void OnRenderUnit()
+ {
+ //m_CBBeforeDepthTexture.ReleaseTemporaryRT(unitDepthTextureID);
+
+ MainCamera.Instance.camera.RemoveCommandBuffer(CameraEvent.BeforeDepthTexture, m_CBBeforeDepthTexture);
+ }
+} \ No newline at end of file
diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs.meta b/Assets/Scripts/Unit/Components/UnitPreprocessing.cs.meta
index a94e86e5..734df2f2 100644
--- a/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs.meta
+++ b/Assets/Scripts/Unit/Components/UnitPreprocessing.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 31492de5533444b49bab8c503b8c6d0f
+guid: 1998e85be970d1541843ff6166f6c771
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Assets/Scripts/Unit/Controller/PCController.cs b/Assets/Scripts/Unit/Controller/PCController.cs
index 90520017..35645d57 100644
--- a/Assets/Scripts/Unit/Controller/PCController.cs
+++ b/Assets/Scripts/Unit/Controller/PCController.cs
@@ -11,8 +11,7 @@ public class PCController : UnitController
#region Unit的三种效果
public UnitAfterImage unitAfterImage;
public UnitImageEffect unitImageEffect;
- public UnitLensEffect unitLensEffect;
- #endregion
+ #endregion
public override UnitType type { get { return UnitType.PC; } }
@@ -36,10 +35,6 @@ public class PCController : UnitController
unitImageEffect = GetOrAddUnitComponent<UnitImageEffect>();
unitImageEffect.Initialize();
-
- unitLensEffect = GetOrAddUnitComponent<UnitLensEffect>();
- unitLensEffect.Initialize();
-
}
public override void Update()
diff --git a/Assets/Scripts/Unit/Controller/UnitController.cs b/Assets/Scripts/Unit/Controller/UnitController.cs
index c75b32b3..971eea62 100644
--- a/Assets/Scripts/Unit/Controller/UnitController.cs
+++ b/Assets/Scripts/Unit/Controller/UnitController.cs
@@ -44,6 +44,8 @@ public class UnitController : MonoBehaviour/*, Interactable*/
public UnitLensEffect unitLensEffect;
+ public UnitPreprocessing unitPreprocessing;
+
public GameObject unitObj; // 角色模型
protected List<UnitComponent> unitComponents;
@@ -184,7 +186,10 @@ public class UnitController : MonoBehaviour/*, Interactable*/
unitLensEffect.Initialize();
unitDetail = gameObject.GetComponentInChildren<UnitDetail>();
- }
+
+ unitPreprocessing = GetOrAddUnitComponent<UnitPreprocessing>();
+ unitPreprocessing.Initialize();
+ }
private void OnPostInitailize()
{
diff --git a/Assets/Scripts/Unit/LensEffect/LensEffect_Buzz.cs b/Assets/Scripts/Unit/LensEffect/LensEffect_Buzz.cs
new file mode 100644
index 00000000..55e8c772
--- /dev/null
+++ b/Assets/Scripts/Unit/LensEffect/LensEffect_Buzz.cs
@@ -0,0 +1,41 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Rendering;
+
+// 蜂鸣
+public class LensEffect_Buzz : LensEffectBase
+{
+ public override ERenderingEvent renderingEvents => ERenderingEvent.AfterForwardAlpha;
+
+ public LensEffect_Buzz() : base()
+ {
+
+ }
+
+ public override void AfterForwardAlpha(EStage stage, CommandBuffer cb)
+ {
+ if(stage == EStage.Before)
+ {
+ Before(cb);
+ }
+ else if(stage == EStage.After)
+ {
+ After(cb);
+ }
+ }
+
+ void Before(CommandBuffer cb)
+ {
+ MaterialEntry buzz = ClaimMaterial(StaticDefine.shaders[EShader.Buzz].name);
+
+ cb.SetGlobalTexture("_UnitDepthTexture", owner.unitPreprocessing.unitDepthTexture);
+ cb.Blit(BuiltinRenderTextureType.CameraTarget, BuiltinRenderTextureType.CameraTarget, buzz.material);
+ }
+
+ void After(CommandBuffer cb)
+ {
+
+ }
+
+} \ No newline at end of file
diff --git a/Assets/Scripts/Unit/LensEffect/LensEffect_Buzz.cs.meta b/Assets/Scripts/Unit/LensEffect/LensEffect_Buzz.cs.meta
new file mode 100644
index 00000000..24b527a2
--- /dev/null
+++ b/Assets/Scripts/Unit/LensEffect/LensEffect_Buzz.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d76bd4e3298fc574e9f90efa626f6e17
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Scripts/Unit/LensEffect/LensEffect_Dash.cs b/Assets/Scripts/Unit/LensEffect/LensEffect_Dash.cs
index 84f8edcb..61bb08fa 100644
--- a/Assets/Scripts/Unit/LensEffect/LensEffect_Dash.cs
+++ b/Assets/Scripts/Unit/LensEffect/LensEffect_Dash.cs
@@ -19,12 +19,11 @@ public class LensEffect_Dash : LensEffectBase
public LensEffect_Dash(Color color, float lifeTime, float angle, UnitSnapshotInfo snapshot) : base()
{
rimColor = color;
- tempID = Shader.PropertyToID("_BlurRim_RT0");
+ tempID = Shader.PropertyToID("RT_Dash");
this.lifeTime = lifeTime;
trs = snapshot.trs;
this.snapshot = UnitManager.Instance.ClaimSnapshotSolo(snapshot);
this.angle = angle;
-
}
public override void AfterForwardOpaque(EStage stage, CommandBuffer cb)