[LayaAir3]Laya3.2.7版worker加载图片404

分析代码发现,给worker传入的url变为atlas/comp/button.png
于是worker得到的url是http://localhost:18090/libs/atlas/comp/button.png,所以出现了404正确的url应该是http://localhost:18090/atlas/comp/button.png
已邀请:

深夜诗人

赞同来自:

需要设置Laya.URL.basePath才行,之前版本不需要设置的。现在不设置,传入worker的资源路径默认是相对路径,就变成了相对于laya.workerloader.js文件的路径了。

深夜诗人

赞同来自:


Laya.URL.__init__函数被修改了。之前版本是这样的。


​class URL {
static __init__() {
null == URL.basePath && (URL.basePath = location && null != location.protocol && "" != location.protocol ? URL.getPath(location.protocol + "//" + location.host + location.pathname) : "")
}
}
现在Laya.URL.__init__变成空函数了

要回复问题请先

商务合作
商务合作