mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-09 08:38:43 +08:00
[ts] Fixed setAnimation naming for string/ref arguments
This commit is contained in:
parent
787af5c8f8
commit
aa5282b398
@ -358,13 +358,13 @@ module spine {
|
||||
this.queue.start(current);
|
||||
}
|
||||
|
||||
setAnimationByName (trackIndex: number, animationName: string, loop: boolean) {
|
||||
setAnimation (trackIndex: number, animationName: string, loop: boolean) {
|
||||
let animation = this.data.skeletonData.findAnimation(animationName);
|
||||
if (animation == null) throw new Error("Animation not found: " + animationName);
|
||||
return this.setAnimation(trackIndex, animation, loop);
|
||||
}
|
||||
|
||||
setAnimation (trackIndex: number, animation: Animation, loop: boolean) {
|
||||
setAnimationWith (trackIndex: number, animation: Animation, loop: boolean) {
|
||||
if (animation == null) throw new Error("animation cannot be null.");
|
||||
let current = this.expandToIndex(trackIndex);
|
||||
if (current != null) {
|
||||
|
||||
@ -143,7 +143,7 @@ module spine {
|
||||
}
|
||||
|
||||
var animationState = this.state = new spine.AnimationState(new spine.AnimationStateData(skeleton.data));
|
||||
animationState.setAnimationByName(0, config.animation, true);
|
||||
animationState.setAnimation(0, config.animation, true);
|
||||
if (config.success) config.success(this);
|
||||
this.loaded = true;
|
||||
requestAnimationFrame(() => { this.render(); });
|
||||
@ -246,7 +246,7 @@ module spine {
|
||||
setAnimation (animationName: string) {
|
||||
if (!this.loaded) throw new Error("Widget isn't loaded yet");
|
||||
this.skeleton.setToSetupPose();
|
||||
this.state.setAnimationByName(0, animationName, this.config.loop);
|
||||
this.state.setAnimation(0, animationName, this.config.loop);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user