[unity] Fixed scene preview conflict between Timeline and SkeletonAnimation animation. Closes #2307.

This commit is contained in:
Harald Csaszar 2023-06-09 19:05:22 +02:00
parent d81ea2d1c1
commit 2d9bdb0ec3
5 changed files with 14 additions and 5 deletions

View File

@ -253,6 +253,10 @@ namespace Spine.Unity {
else else
state.ApplyEventTimelinesOnly(skeleton, issueEvents: true); state.ApplyEventTimelinesOnly(skeleton, issueEvents: true);
AfterAnimationApplied();
}
public void AfterAnimationApplied () {
if (_UpdateLocal != null) if (_UpdateLocal != null)
_UpdateLocal(this); _UpdateLocal(this);

View File

@ -387,6 +387,10 @@ namespace Spine.Unity {
else else
state.ApplyEventTimelinesOnly(skeleton, issueEvents: true); state.ApplyEventTimelinesOnly(skeleton, issueEvents: true);
AfterAnimationApplied();
}
public void AfterAnimationApplied () {
if (UpdateLocal != null) if (UpdateLocal != null)
UpdateLocal(this); UpdateLocal(this);

View File

@ -2,7 +2,7 @@
"name": "com.esotericsoftware.spine.spine-unity", "name": "com.esotericsoftware.spine.spine-unity",
"displayName": "spine-unity Runtime", "displayName": "spine-unity Runtime",
"description": "This plugin provides the spine-unity runtime core.", "description": "This plugin provides the spine-unity runtime core.",
"version": "4.1.12", "version": "4.1.13",
"unity": "2018.3", "unity": "2018.3",
"author": { "author": {
"name": "Esoteric Software", "name": "Esoteric Software",

View File

@ -332,11 +332,12 @@ namespace Spine.Unity.Playables {
toAnimation.Apply(skeleton, 0, toClipTime, clipData.loop, null, clipData.alpha, MixBlend.Setup, MixDirection.In); toAnimation.Apply(skeleton, 0, toClipTime, clipData.loop, null, clipData.alpha, MixBlend.Setup, MixDirection.In);
} }
skeleton.UpdateWorldTransform();
if (skeletonAnimation) { if (skeletonAnimation) {
skeletonAnimation.Update(0); skeletonAnimation.AfterAnimationApplied();
skeletonAnimation.LateUpdate(); skeletonAnimation.LateUpdate();
} else if (skeletonGraphic) { } else if (skeletonGraphic) {
skeletonGraphic.Update(0); skeletonGraphic.AfterAnimationApplied();
skeletonGraphic.LateUpdate(); skeletonGraphic.LateUpdate();
} }
} }

View File

@ -2,7 +2,7 @@
"name": "com.esotericsoftware.spine.timeline", "name": "com.esotericsoftware.spine.timeline",
"displayName": "Spine Timeline Extensions", "displayName": "Spine Timeline Extensions",
"description": "This plugin provides integration of spine-unity for the Unity Timeline.\n\nPrerequisites:\nIt requires a working installation of the spine-unity and spine-csharp runtimes as UPM packages (not as spine-unity unitypackage), version 4.1.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)", "description": "This plugin provides integration of spine-unity for the Unity Timeline.\n\nPrerequisites:\nIt requires a working installation of the spine-unity and spine-csharp runtimes as UPM packages (not as spine-unity unitypackage), version 4.1.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
"version": "4.1.7", "version": "4.1.8",
"unity": "2018.3", "unity": "2018.3",
"author": { "author": {
"name": "Esoteric Software", "name": "Esoteric Software",
@ -11,7 +11,7 @@
}, },
"dependencies": { "dependencies": {
"com.unity.timeline": "1.2.10", "com.unity.timeline": "1.2.10",
"com.esotericsoftware.spine.spine-unity": "4.1.11" "com.esotericsoftware.spine.spine-unity": "4.1.13"
}, },
"keywords": [ "keywords": [
"spine", "spine",