From 22e283ac6c8a7b76fd6a35faf3af47e028efa04e Mon Sep 17 00:00:00 2001 From: John Date: Tue, 20 Jan 2015 01:01:52 +0800 Subject: [PATCH 1/2] AnimationState.cs now fires events during mixing Not sure if the same "fix" needs to be applied to other runtimes, or if this was intended behavior at all. But someone in the forums was looking for this fix. --- spine-csharp/src/AnimationState.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spine-csharp/src/AnimationState.cs b/spine-csharp/src/AnimationState.cs index 3a774b330..97f8d3ade 100644 --- a/spine-csharp/src/AnimationState.cs +++ b/spine-csharp/src/AnimationState.cs @@ -113,7 +113,8 @@ namespace Spine { } else { float previousTime = previous.time; if (!previous.loop && previousTime > previous.endTime) previousTime = previous.endTime; - previous.animation.Apply(skeleton, previousTime, previousTime, previous.loop, null); + previous.animation.Apply(skeleton, previous.lastTime, previousTime, previous.loop, events); + previous.lastTime = previousTime; float alpha = current.mixTime / current.mixDuration * current.mix; if (alpha >= 1) { From f2e8340a24a159aeb31a4836fea3e7680823cffc Mon Sep 17 00:00:00 2001 From: John Date: Fri, 25 Dec 2015 23:11:34 +0800 Subject: [PATCH 2/2] Optional fix code for events during mixing To maintain consistency across runtimes, this fix code is commented out. To use it, remove the old line and uncomment the fix line. --- spine-csharp/src/AnimationState.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spine-csharp/src/AnimationState.cs b/spine-csharp/src/AnimationState.cs index 97f8d3ade..3b1798563 100644 --- a/spine-csharp/src/AnimationState.cs +++ b/spine-csharp/src/AnimationState.cs @@ -113,7 +113,9 @@ namespace Spine { } else { float previousTime = previous.time; if (!previous.loop && previousTime > previous.endTime) previousTime = previous.endTime; - previous.animation.Apply(skeleton, previous.lastTime, previousTime, previous.loop, events); + previous.animation.Apply(skeleton, previous.lastTime, previousTime, previous.loop, null); + // Remove the line above, and uncomment the line below, to allow previous animations to fire events during mixing. + //previous.animation.Apply(skeleton, previous.lastTime, previousTime, previous.loop, events); previous.lastTime = previousTime; float alpha = current.mixTime / current.mixDuration * current.mix;