From a3916b82c89b69c42c0a7816b1c9b1420846c0cd Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Fri, 5 Apr 2019 14:34:08 +0200 Subject: [PATCH] [unity] Fixed SkeletonMecanim leftover animation rotations when transitioning to an empty "Write Defaults" state. Fixes #1321. --- .../Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs index e68bd4d83..d4c611ea2 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs @@ -379,12 +379,13 @@ namespace Spine.Unity { var layerInfos = layerClipInfos[layer]; int clipInfoCount = animator.GetCurrentAnimatorClipInfoCount(layer); int nextClipInfoCount = animator.GetNextAnimatorClipInfoCount(layer); - + var clipInfos = layerInfos.clipInfos; var nextClipInfos = layerInfos.nextClipInfos; var interruptingClipInfos = layerInfos.interruptingClipInfos; - layerInfos.isInterruptionActive = (clipInfoCount == 0 && nextClipInfoCount == 0); + layerInfos.isInterruptionActive = (clipInfoCount == 0 && clipInfos.Count != 0 && + nextClipInfoCount == 0 && nextClipInfos.Count != 0); // Note: during interruption, GetCurrentAnimatorClipInfoCount and GetNextAnimatorClipInfoCount // are returning 0 in calls above. Therefore we keep previous clipInfos and nextClipInfos