Closed flo-wolf closed 7 years ago
Depricated! Use Unity 5 tools instead: SceneManager.LoadSceneAsync
Anticipated result was not achieved through async scene loading. Apparently the hiccups get caused by Start() and Awake() calls of all newly added GameObjects upon scene change. Proper scheduling of those calls through coroutines might fix it, although the implementation of such Monobehaviour extensions might be complicated and possibly not possible due to Unity's script protection.
You can make Start() and Awake() to IEnumerators so unity calls the with a couroutine. Maybe the Start() and Awake() function have too big complexity and needs to be outsourced as well?
Even with Start and Awake IEnumerations the lag will still be there, the calls only get delayed/put on another thread, but they nonetheless draw performance.
I've managed to reduce the lag by quite a big portion through moving complex iterations and resource intensive calls to the start of the game, from where the gathered data gets stored throughout scene changes. The data itself is not memory intensive, which is why this is the best possible solution.
User Coroutines and load your stuff asynchronously. Load assets async is lag free if you do it correctly.
Tried it, it isnt.
So you did not do it correctly. There are games out there which have no lagging loading screens build with Unity 4
Try it yourself then
I did. My loading screen loads every Asset I have (~40MB) and instantiates it to be sure it is loaded. No lag. Some assets take longer but the loading indicator (spinning gear) is still rotating.
http://answers.unity3d.com/questions/274122/load-scene-without-lag.html