mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
set/add animation enables skeleton playing state.
This commit is contained in:
parent
829c3c3e6a
commit
e06739647e
@ -419,15 +419,23 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase {
|
||||
*/
|
||||
|
||||
public setAnimation (track: number, animation: string, loop = false) {
|
||||
const trackEntry = this.state?.setAnimation(track, animation, loop);
|
||||
if (!trackEntry) return;
|
||||
const { state } = this;
|
||||
if (!state) return;
|
||||
|
||||
const trackEntry = state.setAnimation(track, animation, loop);
|
||||
trackEntry.listener = this.makeTrackListener(track, animation);
|
||||
|
||||
this.isPlaying = true;
|
||||
}
|
||||
|
||||
public addAnimation (track: number, animation: string, loop = false, delay = 0) {
|
||||
const trackEntry = this.state?.addAnimation(track, animation, loop, delay);
|
||||
if (!trackEntry) return;
|
||||
const { state } = this;
|
||||
if (!state) return;
|
||||
|
||||
const trackEntry = state.addAnimation(track, animation, loop, delay);
|
||||
trackEntry.listener = this.makeTrackListener(track, animation);
|
||||
|
||||
this.isPlaying = true;
|
||||
}
|
||||
|
||||
public setEmptyAnimation (track: number, mixDuration = 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user