增加spine的stop和stopAll和文档

This commit is contained in:
2026-04-09 18:53:22 +08:00
parent a221d681ab
commit ada885ac14
3 changed files with 77 additions and 17 deletions

View File

@@ -355,12 +355,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 = {};
}
};