summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Unit/Components/UnitAfterImage.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-09-02 09:59:31 +0800
committerchai <chaifix@163.com>2021-09-02 09:59:31 +0800
commit3ad68338dff5229d3fd8ec9f3ee994d7e37fb0ed (patch)
treeb5fbf74148147019f75dd4c078fd76f4804330ec /Assets/Scripts/Unit/Components/UnitAfterImage.cs
parentf7e60ab9a52e557aa2250477d018b2768bccc028 (diff)
*override rootmotion
Diffstat (limited to 'Assets/Scripts/Unit/Components/UnitAfterImage.cs')
-rw-r--r--Assets/Scripts/Unit/Components/UnitAfterImage.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/Assets/Scripts/Unit/Components/UnitAfterImage.cs b/Assets/Scripts/Unit/Components/UnitAfterImage.cs
new file mode 100644
index 00000000..369f63c9
--- /dev/null
+++ b/Assets/Scripts/Unit/Components/UnitAfterImage.cs
@@ -0,0 +1,41 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class AfterImageSpawner
+{
+ private float m_CurTime;
+
+ private float m_Duration;
+
+ public void OnUpdate()
+ {
+ float dt = Time.deltaTime;
+ m_CurTime += dt;
+
+
+ }
+
+}
+
+[DisallowMultipleComponent]
+public class UnitAfterImage : UnitComponent
+{
+
+ private List<AfterImageSpawner> m_Spawners;
+
+ public override void OnUpdate()
+ {
+ base.OnUpdate();
+
+ if(m_Spawners != null)
+ {
+ for(int i = 0; i < m_Spawners.Count; ++i)
+ {
+ m_Spawners[i].OnUpdate();
+ }
+ }
+
+ }
+
+} \ No newline at end of file