mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 01:06:00 +08:00
[unity] Fixed animations not mixing out on some Update When Invisible modes, leaving e.g. leftover slots. Closes #2873.
This commit is contained in:
parent
7247873cf9
commit
636d65d72a
@ -191,6 +191,7 @@ namespace Spine.Unity {
|
||||
if (!valid)
|
||||
return;
|
||||
state = new Spine.AnimationState(skeletonDataAsset.GetAnimationStateData());
|
||||
state.Dispose += OnAnimationDisposed;
|
||||
wasUpdatedAfterInit = false;
|
||||
|
||||
if (!string.IsNullOrEmpty(_animationName)) {
|
||||
@ -302,6 +303,14 @@ namespace Spine.Unity {
|
||||
if (previousUpdateMode != UpdateMode.FullUpdate)
|
||||
LateUpdate();
|
||||
}
|
||||
|
||||
protected virtual void OnAnimationDisposed (TrackEntry entry) {
|
||||
// when updateMode disables applying animations, still ensure animations are mixed out
|
||||
if (updateMode != UpdateMode.FullUpdate &&
|
||||
updateMode != UpdateMode.EverythingExceptMesh) {
|
||||
entry.Animation.Apply(skeleton, 0, 0, false, null, 0f, MixBlend.Setup, MixDirection.Out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user