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.cs14
-rw-r--r--Assets/Scripts/Unit/Components/UnitState/PCState.cs2
2 files changed, 15 insertions, 1 deletions
diff --git a/Assets/Scripts/Unit/Components/UnitLensEffect.cs b/Assets/Scripts/Unit/Components/UnitLensEffect.cs
index 7758c943..a3c5d2c8 100644
--- a/Assets/Scripts/Unit/Components/UnitLensEffect.cs
+++ b/Assets/Scripts/Unit/Components/UnitLensEffect.cs
@@ -140,6 +140,8 @@ public class UnitLensEffect : UnitComponent
}
}
+ List<LensEffectBase> temp = ListPool<LensEffectBase>.Get();
+
for (int i = 0; i < m_Effects.Count; ++i)
{
LensEffectBase eff = m_Effects[i];
@@ -147,8 +149,20 @@ public class UnitLensEffect : UnitComponent
if (method == null)
continue;
method.Invoke(eff, new object[] { });
+ if(eff.CanDestroy())
+ {
+ temp.Add(eff);
+ }
}
+ for(int i = 0; i< temp.Count; ++i)
+ {
+ temp[i].OnDestroy();
+ m_Effects.Remove(temp[i]);
+ }
+
+ ListPool<LensEffectBase>.Release(temp);
+
foreach (var cb in m_InUseCommandBuffers)
{
CameraEvent ce = cb.Key.ToCameraEvent();
diff --git a/Assets/Scripts/Unit/Components/UnitState/PCState.cs b/Assets/Scripts/Unit/Components/UnitState/PCState.cs
index e545dea0..1bdd355f 100644
--- a/Assets/Scripts/Unit/Components/UnitState/PCState.cs
+++ b/Assets/Scripts/Unit/Components/UnitState/PCState.cs
@@ -144,7 +144,7 @@ public partial class PCState : UnitState
UnitSnapshotInfo info = owner.TakeSnapshot();
Vector2 dir = TestErika.Instance.monster.owner.center + new Vector3(offset, -0.5f, 0) - owner.center;
- LensEffect_Dash dash = new LensEffect_Dash(Color.white, 2, Mathf.Atan2(dir.y, dir.x), info);
+ LensEffect_Dash dash = new LensEffect_Dash(Color.white, 0.1f, Mathf.Atan2(dir.y, dir.x), info);
owner.unitLensEffect.AddEffect(dash);
owner.center = TestErika.Instance.monster.owner.center + new Vector3(offset, -0.5f, 0);