summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Unit/Components
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts/Unit/Components')
-rw-r--r--Assets/Scripts/Unit/Components/UnitLensEffect.cs8
-rw-r--r--Assets/Scripts/Unit/Components/UnitState/PCState.cs7
2 files changed, 9 insertions, 6 deletions
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;
}