[unity] Moved skeleton.Update to UpdateAnimationStatus.

This commit is contained in:
Harald Csaszar 2023-11-24 18:09:58 +01:00
parent 83796890a2
commit fb2a76248f
3 changed files with 9 additions and 9 deletions

View File

@ -236,15 +236,16 @@ namespace Spine.Unity {
state.ApplyEventTimelinesOnly(skeleton, issueEvents: false); state.ApplyEventTimelinesOnly(skeleton, issueEvents: false);
return; return;
} }
ApplyAnimation(deltaTime); ApplyAnimation();
} }
protected void UpdateAnimationStatus (float deltaTime) { protected void UpdateAnimationStatus (float deltaTime) {
deltaTime *= timeScale; deltaTime *= timeScale;
state.Update(deltaTime); state.Update(deltaTime);
skeleton.Update(deltaTime);
} }
protected void ApplyAnimation (float deltaTime) { protected void ApplyAnimation () {
if (_BeforeApply != null) if (_BeforeApply != null)
_BeforeApply(this); _BeforeApply(this);
@ -253,7 +254,6 @@ namespace Spine.Unity {
else else
state.ApplyEventTimelinesOnly(skeleton, issueEvents: true); state.ApplyEventTimelinesOnly(skeleton, issueEvents: true);
skeleton.Update(deltaTime);
AfterAnimationApplied(); AfterAnimationApplied();
} }

View File

@ -357,7 +357,7 @@ namespace Spine.Unity {
state.ApplyEventTimelinesOnly(skeleton, issueEvents: false); state.ApplyEventTimelinesOnly(skeleton, issueEvents: false);
return; return;
} }
ApplyAnimation(deltaTime); ApplyAnimation();
} }
protected void SyncSubmeshGraphicsWithCanvasRenderers () { protected void SyncSubmeshGraphicsWithCanvasRenderers () {
@ -381,9 +381,10 @@ namespace Spine.Unity {
protected void UpdateAnimationStatus (float deltaTime) { protected void UpdateAnimationStatus (float deltaTime) {
deltaTime *= timeScale; deltaTime *= timeScale;
state.Update(deltaTime); state.Update(deltaTime);
skeleton.Update(deltaTime);
} }
protected void ApplyAnimation (float deltaTime) { protected void ApplyAnimation () {
if (BeforeApply != null) if (BeforeApply != null)
BeforeApply(this); BeforeApply(this);
@ -392,7 +393,6 @@ namespace Spine.Unity {
else else
state.ApplyEventTimelinesOnly(skeleton, issueEvents: true); state.ApplyEventTimelinesOnly(skeleton, issueEvents: true);
skeleton.Update(deltaTime);
AfterAnimationApplied(); AfterAnimationApplied();
} }

View File

@ -123,10 +123,11 @@ namespace Spine.Unity {
if (updateMode <= UpdateMode.OnlyAnimationStatus) if (updateMode <= UpdateMode.OnlyAnimationStatus)
return; return;
ApplyAnimation(deltaTime); skeleton.Update(deltaTime);
ApplyAnimation();
} }
protected void ApplyAnimation (float deltaTime) { protected void ApplyAnimation () {
if (_BeforeApply != null) if (_BeforeApply != null)
_BeforeApply(this); _BeforeApply(this);
@ -148,7 +149,6 @@ namespace Spine.Unity {
#else #else
translator.Apply(skeleton); translator.Apply(skeleton);
#endif #endif
skeleton.Update(deltaTime);
AfterAnimationApplied(); AfterAnimationApplied();
} }