Skip to content

关于loadDir不能触发错误 #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sanergogogo opened this issue May 27, 2025 · 2 comments
Open

关于loadDir不能触发错误 #6

sanergogogo opened this issue May 27, 2025 · 2 comments

Comments

@sanergogogo
Copy link

app.manager.loader.loadDir({
          path: 'game',
          bundle: 'res',
          onProgress: (finish, total, item) => {
              console.log(finish, total)
          },
          onComplete: (items) => {
          }
      });

loadDir是否还是需要把错误信息也抛出来比较好?
原因是这样的:
使用上面的函数加载指定目录下的所有资源,其中有声音资源(声音资源比较多可能某个声音文件损坏还是怎么样),在chrome和android上面也不会有问题,能正常加载完成,但是使用safari浏览器(包括苹果手机上的)就会加载不完(不触发onComplete)。具体的错误就是大概是load web audio failed。
当然最好的办法是把声音文件修复好,但是有时候文件可能比较多,也可能是其他文件出了问题,不好定位。

@a1076559139
Copy link
Owner

如果onComplete不触发的话,那似乎是Cocos没有触发,并不是XForge把回掉吞掉了

args.push((err: string, res: any) => {

@sanergogogo
Copy link
Author

看起来是这样,这几天忙,我过2天用cocos原始的看下吧。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants