cocos creator 3.6.1 使用async 定义函数去异步下载bundle。苹果可以,安卓却不行,然后苹果只要等第一批bundle,安卓用户中间要等好长时间,有哪位大神指点迷津啊 
…
public static bundles=[“bundle1”,“bundle2”,“bundle3”,]
…
async loadResAsync(){
for(let i=0; i<Const.bundles.length; i++){
await GamePublic.loadBundle(Const.bundles[i])
}
}
…
public static loadBundle(name: string) {
return new Promise(result => {
assetManager.loadBundle(name, (err, bundle) => {
result(bundle);
if (err) {
return console.error(err);
}
if (err) {
console.error(‘加载bundle错误:’, name, err)
return;
}
})
})
}
安卓可能没有多线程,可以使用update进行异步操作
这样会不会快一些
async loadResAsync(){
let pendings = [];
for(let i=0; i<Const.bundles.length; i++){
pendings.push(GamePublic.loadBundle(Const.bundles[i]));
}
await Promise.all(pendings);
}
这个建议好啊
,就是怕玩家玩游戏的时候后台下载太猛卡主,目前已经会出现小小的卡顿。
我试一试,感谢关注 
ok,完美解决问题,安卓和苹果都光速加载了。除了首包要硬性加载。
我是不敢在 循环里 await 的