Browse Source

[unity] Moved `skeleton.Update` to UpdateAnimationStatus.

Harald Csaszar 1 year ago
parent
commit
fb2a76248f

+ 3 - 3
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();
 		}
 

+ 3 - 3
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();
 		}
 

+ 3 - 3
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();
 		}