From 5d78359b7c90363e3c56ee7b4439d1542a5d804a Mon Sep 17 00:00:00 2001 From: pharan Date: Thu, 18 May 2017 09:11:42 +0800 Subject: [PATCH] [csharp] Limit linked list by speeding up, see https://github.com/EsotericSoftware/spine-runtimes/commit/0f944b2baf8ae88bfb12f84b41b07592906b3da6 --- spine-csharp/src/AnimationState.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spine-csharp/src/AnimationState.cs b/spine-csharp/src/AnimationState.cs index f38e5f599..eedecea65 100644 --- a/spine-csharp/src/AnimationState.cs +++ b/spine-csharp/src/AnimationState.cs @@ -140,9 +140,13 @@ namespace Spine { // Require mixTime > 0 to ensure the mixing from entry was applied at least once. if (entry.mixTime > 0 && (entry.mixTime >= entry.mixDuration || entry.timeScale == 0)) { - if (animationCount > 6 && from.mixingFrom == null) { // Limit the mixing from linked list. - entry.mixingFrom = null; - queue.End(from); + if (animationCount > 5 && from.mixingFrom == null) { + // Limit linked list by speeding up and removing old entries. + entry.interruptAlpha = Math.Max(0, entry.interruptAlpha - delta * 0.66f); + if (entry.interruptAlpha <= 0) { + entry.mixingFrom = null; + queue.End(from); + } } return finished; }