Explorar o código

[ts] Fixed setAnimation naming for string/ref arguments

badlogic %!s(int64=9) %!d(string=hai) anos
pai
achega
aa5282b398
Modificáronse 2 ficheiros con 4 adicións e 4 borrados
  1. 2 2
      spine-ts/core/src/AnimationState.ts
  2. 2 2
      spine-ts/widget/src/Widget.ts

+ 2 - 2
spine-ts/core/src/AnimationState.ts

@@ -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) {

+ 2 - 2
spine-ts/widget/src/Widget.ts

@@ -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);
 		}