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) {
|
public setAnimation (track: number, animation: string, loop = false) {
|
||||||
const trackEntry = this.state?.setAnimation(track, animation, loop);
|
const { state } = this;
|
||||||
if (!trackEntry) return;
|
if (!state) return;
|
||||||
|
|
||||||
|
const trackEntry = state.setAnimation(track, animation, loop);
|
||||||
trackEntry.listener = this.makeTrackListener(track, animation);
|
trackEntry.listener = this.makeTrackListener(track, animation);
|
||||||
|
|
||||||
|
this.isPlaying = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public addAnimation (track: number, animation: string, loop = false, delay = 0) {
|
public addAnimation (track: number, animation: string, loop = false, delay = 0) {
|
||||||
const trackEntry = this.state?.addAnimation(track, animation, loop, delay);
|
const { state } = this;
|
||||||
if (!trackEntry) return;
|
if (!state) return;
|
||||||
|
|
||||||
|
const trackEntry = state.addAnimation(track, animation, loop, delay);
|
||||||
trackEntry.listener = this.makeTrackListener(track, animation);
|
trackEntry.listener = this.makeTrackListener(track, animation);
|
||||||
|
|
||||||
|
this.isPlaying = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public setEmptyAnimation (track: number, mixDuration = 0) {
|
public setEmptyAnimation (track: number, mixDuration = 0) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user