summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Unit/LensEffect/LensEffect_Buzz.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts/Unit/LensEffect/LensEffect_Buzz.cs')
-rw-r--r--Assets/Scripts/Unit/LensEffect/LensEffect_Buzz.cs41
1 files changed, 41 insertions, 0 deletions
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