[0]spine 播放错乱

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

B`TK{3@5B6S766UMO()7ZG7.png

 
正常示例

NEB}8Y79`@PGF0`JUKFCH4.png

 
已邀请:

Laya_z

赞同来自:

用你的资源测试了一下,没有问题呀,很正常,你用的是哪个版本引擎,用最新版的试一下

136*****205

赞同来自:

3V(B5PT6MXFTL9E5IRSMK6V.png

都勾选了

Laya_z

赞同来自:

把你出问题的demo传上来吧

136*****205

赞同来自:

1111.png

找到问题了,IDE 生成了图集,读取的是图集,所以spine显示错误了

136*****205

赞同来自:

O5(WTULJJFHTLE5Y3845ZS.png

这里有个问题,每次f12发布后,类库的顺序都要调转,不然类库初始化失败
laya.spine.js 依赖了 spine-core-3.7.js, spine-core-3.7.js必须放前面

要回复问题请先

商务合作
商务合作