[LayaAir 2.0]worker如何使用

Laya.WorkerLoader.workerPath = "libs/worker.js";
//开启worker线程
Laya.WorkerLoader.enable = true;
//加载引擎需要的资源
Laya.loader.load("res/atlas/comp.atlas", Laya.Handler.create(this, () => {
alert("onLoaded!");
}), null, Laya.Loader.ATLAS, 1, true, null, false, true);
 
useWorkerLoader参数设为true后,文件加载不成功?
已邀请:

180*****998

赞同来自:

@param
useWorkerLoader
— (default = false)是否使用worker加载(只针对IMAGE类型和ATLAS类型,并且浏览器支持的情况下生效)
可能是浏览器不支持的原因吧

要回复问题请先

商务合作
商务合作