我正在尝试异步加载一个场景,所以我可以有一个很好的进度条,我发现返回的AsyncOperation.progress停在0.9。我没有遇到任何问题,但发生的事情是,在此之后,加载场景需要多达50秒才会显示进度。删除一些对象后,我发现有1个(主要场景对象)导致了这种延迟。
我的问题是,有没有办法在前90%的负载中加载这个对象(现在发生速度超快 - 1s)?
提前致谢
答案 0 :(得分:2)
If this GameObject is inside the scene, it is loaded with the scene. The problem you have is with the all script logic inside the scene. The loading thread actually finished, but the scripts, instantieting etc., takes all device resources and it looks like stuck at 90%.
To solve it I think you should delay all scripts executions on Awake or Start methods. That should help, but still all the time needed on particular device to execute scripts will take all CPU, and will look like stuck again.
答案 1 :(得分:1)
所以,似乎这一切都来自我正在使用的物质。这对我来说真的很奇怪,因为我明确地将它们全部检查为"烘焙和丢弃物质"这似乎无能为力。烘烤所有纹理并在材料中从物质切换到纹理后,负载从42s下降到1s