[0]Spine 间隔一段时间卡顿5000毫秒左右,期间GPU占用极高, Demo已上传


import WebGL = Laya.WebGL;
import Browser = Laya.Browser;
import Stat = Laya.Stat;
import Templet = Laya.Templet;
import Skeleton = Laya.Skeleton; 
class Main { 
constructor() {
WebGL.enable();
Laya.init(Browser.width, Browser.height);
Stat.show(); 
//棋子动画
this.genSpine("res/spine/ludo_qizidongzuo.skel", Laya.Handler.create(this, (templet: Laya.SpineTemplet) => { 
//模版复用
let y = 400;
let unitWidth = Laya.stage.width / 16;
for (let i = 0; i < 16; i++) {
let person = templet.buildArmature();
Laya.stage.addChild(person);
person.x = i * unitWidth;
person.y = y;
person.play("hongse_daiji", true);
}
})); 
//飞碟
this.genSpine("res/spine/ludo_feidie.skel", Laya.Handler.create(this, (templet: Laya.SpineTemplet) => {
 
//只需要生成一个
let ufo = templet.buildArmature();
Laya.stage.addChild(ufo);
ufo.x = Laya.stage.width / 2;
ufo.y = Laya.stage.height / 2;
ufo.play("ludo_ufo_kaishi", false);
ufo.once(Laya.Event.STOPPED, this, () => {
ufo.play("ludo_ufo_feixing", true);
});
ufo.on(Laya.Event.LABEL, this, (e) => {
if (e.name == "xiaoshi") {
ufo.offAllCaller(this);
// ufo.removeSelf();
 
}
}); 
}));

genSpine(url, handler: Laya.Handler) {
var templet = new Laya.SpineTemplet(Laya.SpineVersion.v4_0);
templet.on(Laya.Event.COMPLETE, handler.caller, handler.method);
templet.on(Laya.Event.ERROR, this, this.printError);
templet.loadAni(url);

printError(e) {
console.error(e);
}
}
//激活启动类
new Main();


39bcfae7aa6289a0364fffd5a181b8bc.png
已邀请:

第七天堂

赞同来自:

找到原因了。是滤镜造成的我们去掉了Spine文件里的滤镜后 满屏Spine都没有出现卡顿现象

第七天堂

赞同来自:

Spine动画滤镜这个问题引起的性能缺陷 能否有时间解决一下呢

要回复问题请先

商务合作
商务合作