[code]templet: Laya.SpineTemplet;
skeleton: Laya.SpineSkeleton;
index = 0;
private startFun(): void {
//创建动画模板
this.templet = new Laya.SpineTemplet();
this.templet.loadAni("spine/10101001.json");
this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
this.templet.on(Laya.Event.ERROR, this, this.onError);
}
private parseComplete(): void {
this.skeleton = this.templet.buildArmature();
Laya.stage.addChild(this.skeleton);
this.skeleton.pos(Laya.Browser.width / 2, Laya.Browser.height / 2 + 100);
//this.skeleton.scale(0.5, 0.5);
this.skeleton.on(Laya.Event.STOPPED, this, this.play);
this.play();
}
private onError() {
console.error("load spine error");
}
private play(): void {
console.log("1111111111");
if (++this.index >= this.skeleton.getAnimNum()) {
this.index = 0;
}
this.skeleton.play(this.index, false, true);
}[/code]
正常示例

附件:
spine.zip