Building Player Baking Runtime Android 永远加载

Building Player Baking Runtime Android Forever Loading

我一直在 Unity 上构建一个包含 3 个场景的 Android 应用。前两个场景效果很好,但最后一个场景给我带来了麻烦。游戏一直在那个场景崩溃

因此,在查看 Unity 论坛时,他们建议我将所有对象复制粘贴到一个新场景中,然后尝试查看是否可行。

但既然我已经这样做了,我什至无法导出它。在构建播放器时,我的加载程序卡在了这里:Building Scene 2: Name (10/15 Bake Runtime | 1 jobs)

我没有更改设置中的任何其他内容,如果我删除第 3 个场景,它会正常构建。当我只添加第三个场景时,它会卡在同一个场景上。

可能是什么问题?

没有关于您使用的统一版本的信息,但在 Unity 5.1 更新日志中据说他们从光照贴图烘焙中删除了崩溃:

Lightmapping: Fixed race condition crash in lightmap bake when converting .exr files.

如果有人仍然遇到此崩溃,也许考虑更新 Unity 会更好?这可能是你的情况。

从“编辑”>“首选项”菜单中清除您的 GI 缓存,我遇到了类似的问题并通过这样做修复了它 如果您无法清除 GI 缓存,请转到 Lightning window 并取消选中自动构建复选标记关闭统一并再次打开...

这个版本的Unity现在已经过时了,我相信较新版本的Unity不会有这个问题。

The GI cache is used by the Global Illumination system to store intermediate files when precomputing real-time GI, and when baking Static Lightmaps, Light Probes and Reflection Probes. The cache is shared between all Unity projects on the computer, so projects with the same content and same version of the lighting system (Enlighten) can share the files and speed up subsequent builds.

但有时 GI 缓存文件会导致严重的性能问题。如果是这样,您应该 automatically 使用按钮在 Unity 首选项中清理 GI 缓存文件:

P.S。在编辑器运行时手动删除GI缓存目录是不安全的。这是因为编辑器在启动时会创建 GiCache 文件夹,并维护一组对这些文件的引用。清除缓存按钮确保编辑器在删除文件之前释放对磁盘上文件的所有引用。