[0]Laya3.0正式版spine3.8的动画资源不能正常显示

代码直接搬的api示例,警告和错误信息如下,但是引擎的示例工程又是可以,本来怀疑是因为引擎版本升级问题,我又重新新建了一个空的新工程,一样的资源,一样的代码,还是一样的错误信息
代码:
import SpineSkeleton = Laya.SpineSkeleton;
import Loader = Laya.Loader;
import SpineTemplet = Laya.SpineTemplet;

const { regClass, property } = Laya;

@regClass()
export class Main extends Laya.Script {
private skeleton: SpineSkeleton;
private index: number = -1;
public pageWidth: number;
public pageHeight: number;
onStart() {
console.log("Game start");
Laya.loader.load("resources/res/spineboy-pma.skel", Loader.SPINE).then((templet: SpineTemplet) => {
this.skeleton = new SpineSkeleton();
this.skeleton.templet = templet;
this.owner.addChild(this.skeleton);
this.skeleton.pos( this.pageWidth / 2, this.pageHeight / 2 + 100);
this.skeleton.scale(0.4, 0.4);
this.skeleton.on(Laya.Event.STOPPED, this, this.play);
this.play();
});
}
private play(): void {
if (++this.index >= this.skeleton.getAnimNum()) {
this.index = 0
}
this.skeleton.play(this.index, false, true)
}
}
已邀请:

UCoyote

赞同来自:

忽略,是项目设置里忘记勾选laya.spine库,只修改了spine的运行库版本

该问题目前已经被锁定, 无法添加新回复

商务合作
商务合作