summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Unit/TimelineEventProxy.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-09-04 14:02:24 +0800
committerchai <chaifix@163.com>2021-09-04 14:02:24 +0800
commit34d01108e9f0c5488e8824f768c43801dd8ed4cc (patch)
tree8656926dc0fdb116590e295ce1038a192bc0eca3 /Assets/Scripts/Unit/TimelineEventProxy.cs
parent18a46c5eda8dad703eca557c6553f7f0ed3461af (diff)
*misc
Diffstat (limited to 'Assets/Scripts/Unit/TimelineEventProxy.cs')
-rw-r--r--Assets/Scripts/Unit/TimelineEventProxy.cs48
1 files changed, 27 insertions, 21 deletions
diff --git a/Assets/Scripts/Unit/TimelineEventProxy.cs b/Assets/Scripts/Unit/TimelineEventProxy.cs
index da4185a7..2c5bf608 100644
--- a/Assets/Scripts/Unit/TimelineEventProxy.cs
+++ b/Assets/Scripts/Unit/TimelineEventProxy.cs
@@ -131,25 +131,28 @@ public partial class TimelineEventProxy
m_PrevFrame = frame;
}
- #region Event Handles
+ void ExecuteEvents(List<AnimationEventBase> events)
+ {
+ if (events == null || events.Count == 0)
+ return;
+ foreach (var e in events)
+ {
+ string name = e.type.ToString();
+ MethodInfo method = GetType().GetMethod(name, BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[] { typeof(AnimationEventBase) }, null);
+ if (method != null)
+ {
+ object[] param = new object[] { e };
+ method.Invoke(this, param);
- void ExecuteEvents(List<AnimationEventBase> events)
- {
- if (events == null || events.Count == 0)
- return;
- foreach (var e in events)
- {
- string name = e.type.ToString();
- MethodInfo method = GetType().GetMethod(name, BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[] { typeof(AnimationEventBase) }, null);
- if (method != null)
- {
- object[] param = new object[] { e };
- method.Invoke(this, param);
- }
- }
- }
-
- void EventEffect(AnimationEventBase animEvent)
+ if(owner != null)
+ owner.onTimelineEvent(e);
+ }
+ }
+ }
+
+ #region Event Handles
+
+ void EventEffect(AnimationEventBase animEvent)
{
EventEffect effect = animEvent as EventEffect;
if (effect == null)
@@ -204,13 +207,16 @@ public partial class TimelineEventProxy
GameObject obj = GameObject.Instantiate(prefab);
Projectile projectile = obj.GetComponent<Projectile>();
ProjectileInfo info = new ProjectileInfo();
+ info.name = e.name;
+ info.tag = e.tag;
+ info.moveType = e.moveType;
info.owner = owner;
info.position = m_Root.transform.position + e.posOffset;
info.rotation = e.rotation;
info.scale = e.scale;
- info.direction = Vector3.right;
- info.velocity = Vector3.right * 10f;
- info.lifetime = 5;
+ info.velocity = e.velocity;
+ info.acceleration = e.acceleration;
+ info.lifetime = e.lifeTime;
info.sparkPath = e.sparkPath;
projectile.Initialize(info);