修改stop之后setAnimation不显示的bug

This commit is contained in:
2026-04-09 19:01:41 +08:00
parent ada885ac14
commit e2f8054794
3 changed files with 69 additions and 7 deletions

View File

@@ -227,6 +227,7 @@ var SpineMgr = {
this._queueCmd(id, "setAnimation", [animName, loop, track]);
return null;
}
e.visible = true;
if (!e.ready) {
this._queueCmd(id, "setAnimation", [animName, loop, track]);
return null;
@@ -355,12 +356,35 @@ var SpineMgr = {
}
},
stop: function(id) {
var e = this._entries[id];
if (!e) return;
e.visible = false;
e._hideOnComplete = false;
e._hideAfterCompletes = 0;
delete this._pendingCmds[id];
if (e.state) {
e.state.clearTracks();
}
if (e.skeleton) {
e.skeleton.setToSetupPose();
}
},
stopAll: function() {
for (var id in this._entries) {
this.stop(id);
}
},
remove: function(id) {
delete this._entries[id];
delete this._pendingCmds[id];
},
removeAll: function() {
this._entries = {};
this._pendingCmds = {};
}
};