diff options
author | chai <chaifix@163.com> | 2021-09-30 09:39:47 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-09-30 09:39:47 +0800 |
commit | 76745de7a04e46d18319c734067fa49641370014 (patch) | |
tree | a4c3c36bc58a4b31c8dc3024c68818e9e0d7de94 /Assets/Scripts/Unit/LensEffect | |
parent | b781f9ecf36bcc6c614538ac427fa2eb8f1e29d2 (diff) |
*Unit Preprocessing
Diffstat (limited to 'Assets/Scripts/Unit/LensEffect')
-rw-r--r-- | Assets/Scripts/Unit/LensEffect/LensEffect_Buzz.cs | 41 | ||||
-rw-r--r-- | Assets/Scripts/Unit/LensEffect/LensEffect_Buzz.cs.meta | 11 | ||||
-rw-r--r-- | Assets/Scripts/Unit/LensEffect/LensEffect_Dash.cs | 3 |
3 files changed, 53 insertions, 2 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 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) |