Search Unity

Strange LoadSceneAsync behaviour

Discussion in 'Editor & General Support' started by adrian-lupsan, Jun 8, 2017.

  1. adrian-lupsan

    adrian-lupsan

    Joined:
    Jul 4, 2016
    Posts:
    9
    Hi guys!

    I am working on a VR game for Vive and Oculus and I am currently dealing with a strange behaviour when I switch between two scenes.

    Scene 1: realtime lighting, up to about 300k tris
    Scene 2: baked lighting, about 60-70k tris when initially loaded

    In order to switch from Scene 1 to Scene 2 I have created an intermediary loading scene that contains just a canvas with loading text.

    My scene load logic looks something like this:

    Code (CSharp):
    1.     private IEnumerator LoadNewScene()
    2.     {
    3.  
    4.         Application.backgroundLoadingPriority = ThreadPriority.Low;
    5.         async = SceneManager.LoadSceneAsync("Scene2");
    6.  
    7.         while (!async.isDone)
    8.         {
    9.             yield return null;
    10.         }
    11.  
    12.     }
    Moving from Scene 1 to the loading scene is almost immediate. The problem and the strange behaviour comes when moving from the intermediary scene to Scene 2 which is more complex as mentioned above. It takes a lot of time - about 30 seconds... I have tried to disable all objects in Scene 2 but the time is the same which is again strange.

    Other thing which I think that is strange is that when I try to load Scene 2 directly from Scene 1... it loads in like... 3 seconds!

    Am I missing something in the way Unity is loading the scenes? Is this behaviour normal?