[0]Spine3.8.75报错:Error: Unsupported skeleton data, please export with a newer version of Spine.
我使用spine3.8.75导出的文件无法使用。代码是使用的2.12.2beta1引擎示例的源码。
var Browser = Laya.Browser;
var WebGL = Laya.WebGL;
var Stage = Laya.Stage;
var Event = Laya.Event;
var Stat = Laya.Stat;
var SpineTemplet = Laya.SpineTemplet;
class SpineBinary {
constructor() {
this.aniPath = "res/powerup-pro.skel";
this.index = -1;
// Laya.init(Browser.width, Browser.height, WebGL);
// Laya.stage.scaleMode = Stage.SCALE_NOSCALE;
// Laya.stage.bgColor = "#232628";
// Stat.show();
this.startFun();
}
startFun() {
this.templet = new SpineTemplet(Laya.SpineVersion.v3_8);
this.templet.loadAni(this.aniPath);
this.templet.on(Event.COMPLETE, this, this.parseComplete);
this.templet.on(Event.ERROR, this, this.onError);
}
parseComplete() {
this.skeleton = this.templet.buildArmature();
Laya.stage.addChild(this.skeleton);
this.skeleton.pos(laya_width/2,laya_height/2);
this.skeleton.scale(0.5, 0.5);
this.skeleton.on(Event.STOPPED, this, this.play);
this.play();
}
onError() {
console.log("parse error");
}
play() {
console.log("1111111111");
if (++this.index >= this.skeleton.getAnimNum()) {
this.index = 0;
}
this.skeleton.play(0, false, true);
}
}
new SpineBinary;
使用官方示例的动画文件能正常显示,自己用3.8.75生成的不能显示,我把文件上传到了附件
var Browser = Laya.Browser;
var WebGL = Laya.WebGL;
var Stage = Laya.Stage;
var Event = Laya.Event;
var Stat = Laya.Stat;
var SpineTemplet = Laya.SpineTemplet;
class SpineBinary {
constructor() {
this.aniPath = "res/powerup-pro.skel";
this.index = -1;
// Laya.init(Browser.width, Browser.height, WebGL);
// Laya.stage.scaleMode = Stage.SCALE_NOSCALE;
// Laya.stage.bgColor = "#232628";
// Stat.show();
this.startFun();
}
startFun() {
this.templet = new SpineTemplet(Laya.SpineVersion.v3_8);
this.templet.loadAni(this.aniPath);
this.templet.on(Event.COMPLETE, this, this.parseComplete);
this.templet.on(Event.ERROR, this, this.onError);
}
parseComplete() {
this.skeleton = this.templet.buildArmature();
Laya.stage.addChild(this.skeleton);
this.skeleton.pos(laya_width/2,laya_height/2);
this.skeleton.scale(0.5, 0.5);
this.skeleton.on(Event.STOPPED, this, this.play);
this.play();
}
onError() {
console.log("parse error");
}
play() {
console.log("1111111111");
if (++this.index >= this.skeleton.getAnimNum()) {
this.index = 0;
}
this.skeleton.play(0, false, true);
}
}
new SpineBinary;
使用官方示例的动画文件能正常显示,自己用3.8.75生成的不能显示,我把文件上传到了附件
没有找到相关结果
已邀请:
要回复问题请先登录
6 个回复
Laya_z
赞同来自:
wrecking
赞同来自:
wrecking
赞同来自:
kylin9718
赞同来自:
检查spine官方的提交记录,是在解决单骨骼IK时添加的限制。
建议您使用更高版本Spine IDE重新导出
1679813383用户
赞同来自:
LastYear
赞同来自: