From 74560c66a3590ea9ad6e8b68d595968f1c401e48 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Thu, 2 May 2019 11:19:04 +0200 Subject: [PATCH] [unity] Fixed error message "Animator is not playing an AnimatorController" at SkeletonMecanim and prefabs. Closes #1344. --- .../Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 d4c611ea2..184755066 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs @@ -81,8 +81,12 @@ namespace Spine.Unity { if (Application.isPlaying) { translator.Apply(skeleton); } else { - if (translatorAnimator != null && translatorAnimator.isInitialized) + if (translatorAnimator != null && translatorAnimator.isInitialized && + translatorAnimator.isActiveAndEnabled && translatorAnimator.runtimeAnimatorController != null) { + // Note: Rebind is required to prevent warning "Animator is not playing an AnimatorController" with prefabs + translatorAnimator.Rebind(); translator.Apply(skeleton); + } } #else translator.Apply(skeleton);