From fb2a76248f768017b0c1d1ddfacd51deefa09ef5 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Fri, 24 Nov 2023 18:09:58 +0100 Subject: [PATCH] [unity] Moved `skeleton.Update` to UpdateAnimationStatus. --- .../Runtime/spine-unity/Components/SkeletonAnimation.cs | 6 +++--- .../Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs | 6 +++--- .../Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs index b3d4d0aa4..da3c094fe 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs @@ -236,15 +236,16 @@ namespace Spine.Unity { state.ApplyEventTimelinesOnly(skeleton, issueEvents: false); return; } - ApplyAnimation(deltaTime); + ApplyAnimation(); } protected void UpdateAnimationStatus (float deltaTime) { deltaTime *= timeScale; state.Update(deltaTime); + skeleton.Update(deltaTime); } - protected void ApplyAnimation (float deltaTime) { + protected void ApplyAnimation () { if (_BeforeApply != null) _BeforeApply(this); @@ -253,7 +254,6 @@ namespace Spine.Unity { else state.ApplyEventTimelinesOnly(skeleton, issueEvents: true); - skeleton.Update(deltaTime); AfterAnimationApplied(); } diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs index 7fca45582..9195d4e21 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs @@ -357,7 +357,7 @@ namespace Spine.Unity { state.ApplyEventTimelinesOnly(skeleton, issueEvents: false); return; } - ApplyAnimation(deltaTime); + ApplyAnimation(); } protected void SyncSubmeshGraphicsWithCanvasRenderers () { @@ -381,9 +381,10 @@ namespace Spine.Unity { protected void UpdateAnimationStatus (float deltaTime) { deltaTime *= timeScale; state.Update(deltaTime); + skeleton.Update(deltaTime); } - protected void ApplyAnimation (float deltaTime) { + protected void ApplyAnimation () { if (BeforeApply != null) BeforeApply(this); @@ -392,7 +393,6 @@ namespace Spine.Unity { else state.ApplyEventTimelinesOnly(skeleton, issueEvents: true); - skeleton.Update(deltaTime); AfterAnimationApplied(); } 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 529c4d918..31d85ee69 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs @@ -123,10 +123,11 @@ namespace Spine.Unity { if (updateMode <= UpdateMode.OnlyAnimationStatus) return; - ApplyAnimation(deltaTime); + skeleton.Update(deltaTime); + ApplyAnimation(); } - protected void ApplyAnimation (float deltaTime) { + protected void ApplyAnimation () { if (_BeforeApply != null) _BeforeApply(this); @@ -148,7 +149,6 @@ namespace Spine.Unity { #else translator.Apply(skeleton); #endif - skeleton.Update(deltaTime); AfterAnimationApplied(); }