Merge pull request #344 from pharan/patch-1

[C#] Optional fix for firing events when mixing


This allows previous animations to fire its events during mixing/crossfading.

To maintain consistency across runtimes, this fix code is commented out.
To use it, remove the old line and uncomment the fix line.
This commit is contained in:
John 2015-12-25 23:15:27 +08:00
commit 9a7aeb1ae0

View File

@ -114,7 +114,10 @@ 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, 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;
if (alpha >= 1) {