[]微信小游戏手动缓存管理,atlas依然不能从缓存读取

https://ldc.layabox.com/doc/?nav=zh-js-5-0-5
此文档中提到只有声音和图片是自动缓存的,
其他类型文件可以通过Laya.MiniAdpter.downLoadFile进行缓存
 
使用如下代码尝试缓存atlas文件
Laya.ext.toCache = [
'res/atlas/fonts.atlas',
'res/atlas/image/items.atlas',
'res/atlas/image/orb.atlas',
'animate/shiny.atlas',
'res/atlas/image/interface.atlas',
'animate/explosion.atlas',
'animate/mine.atlas',
'res/atlas/image/game.atlas',
]

for(let i = 0;i<Laya.ext.toCache.length;i++){
      Laya.MiniAdpter.downLoadFile(baseURL+Laya.ext.toCache[i])
}
执行后可以在Laya.MiniAdpter.getFileList()查找到对应缓存
 
但使用Laya.loader.load预加载图片与atlas时,图片可以正常从usr/layaairGame/中读取
atlas文件依旧从远程读取
 
如何使atlas从本地路径读取?
(虽然atlas文件尺寸不大,但这样不能离线运行游戏了,求助。谢谢
已邀请:

智力猫

赞同来自:

昨天看了一天laya.wxmini.js文件,水平太低没找到解决方案...
直接用微信api缓存的素材
解决方案如下,欢迎参考:https://github.com/witcat/LayaWxCacheFromZip

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

商务合作
商务合作