From 142b0b9264d9b8da81f173ec92d153d52f67ae06 Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 2 Oct 2021 18:46:26 +0800 Subject: *misc --- Assets/Scripts/Unit/Components/UnitLensEffect.cs | 8 ++++---- Assets/Scripts/Unit/Components/UnitState/PCState.cs | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'Assets/Scripts/Unit/Components') diff --git a/Assets/Scripts/Unit/Components/UnitLensEffect.cs b/Assets/Scripts/Unit/Components/UnitLensEffect.cs index 23539de0..e145c331 100644 --- a/Assets/Scripts/Unit/Components/UnitLensEffect.cs +++ b/Assets/Scripts/Unit/Components/UnitLensEffect.cs @@ -102,7 +102,7 @@ public partial class UnitLensEffect : UnitComponent if (method == null) continue; eff.owner = owner; - method.Invoke(eff, new object[] { LensEffectBase.EStage.Before, cb.Value }); + method.Invoke(eff, new object[] { LensEffectBase.EStage.BeforeIterate, cb.Value }); // iterate unit renderers for (int j = 0; j < body.renderers.Length; ++j) @@ -114,7 +114,7 @@ public partial class UnitLensEffect : UnitComponent method.Invoke(eff, new object[] { LensEffectBase.EStage.Iterate, cb.Value }); } - method.Invoke(eff, new object[] { LensEffectBase.EStage.After, cb.Value }); + method.Invoke(eff, new object[] { LensEffectBase.EStage.AfterIterate, cb.Value }); } MainCamera.Instance.camera.AddCommandBuffer(ce, cb.Value); } @@ -125,7 +125,7 @@ public partial class UnitLensEffect : UnitComponent if (m_Effects == null || m_Effects.Count == 0) return; - // 执行每个event的finish + // 执行每个event的finisher foreach (var cb in m_InUseCommandBuffers) { ERenderingEvent re = cb.Key; @@ -137,7 +137,7 @@ public partial class UnitLensEffect : UnitComponent MethodInfo method = eff.GetType().GetMethod(re.ToString(), BindingFlags.Instance | BindingFlags.Public, null, new Type[] { typeof(LensEffectBase.EStage), typeof(CommandBuffer) }, null); if (method == null) continue; - method.Invoke(eff, new object[] { LensEffectBase.EStage.Finished, cb.Value }); + method.Invoke(eff, new object[] { LensEffectBase.EStage.FinishRender, cb.Value }); } } diff --git a/Assets/Scripts/Unit/Components/UnitState/PCState.cs b/Assets/Scripts/Unit/Components/UnitState/PCState.cs index 22855aeb..6a326431 100644 --- a/Assets/Scripts/Unit/Components/UnitState/PCState.cs +++ b/Assets/Scripts/Unit/Components/UnitState/PCState.cs @@ -142,11 +142,14 @@ public partial class PCState : UnitState { float offset = owner.isTowardRight ? 1.5f : -1.5f; + Vector3 targetPos = TestErika.Instance.monster.owner.center + new Vector3(offset, -0.5f, 0); + targetPos.y = Mathf.Max(1, targetPos.y); + UnitSnapshotInfo info = owner.TakeSnapshot(); - Vector2 dir = TestErika.Instance.monster.owner.center + new Vector3(offset, -0.5f, 0) - owner.center; + Vector2 dir = targetPos - owner.center; owner.unitLensEffect.Dash(Color.white, 0.1f, Mathf.Rad2Deg * Mathf.Atan2(dir.y, dir.x), info); - owner.center = TestErika.Instance.monster.owner.center + new Vector3(offset, -0.5f, 0); + owner.center = targetPos; TurnAround(!owner.isTowardRight); return true; } -- cgit v1.1-26-g67d0