Asynchronous loading of additive scene during splash screen

I’m trying to load several scenes during a splash screen. I’m able to load a portion of the scene properly - it’s the part that uses LoadSceneMode.Single. It will load into the background just fine and I can see progress on the load.

However, when I get to loading the additional scenes, progress never increments. This code just hangs in the second while loop.

         AsyncOperation o = SceneManager.LoadSceneAsync(loadLevel);
         o.allowSceneActivation = false;
         while (o.progress < 0.9f) {
            Debug.Log("Main scene loading: " + o.progress.ToString("F4"));
            yield return new WaitForEndOfFrame();
         }

         AsyncOperation[] additionalScenes = null;
         additionalScenes = new AsyncOperation[m_AdditionalLevelsMobile.Length];
         for(int i = 0; i < m_AdditionalLevelsMobile.Length; i++) {
            additionalScenes[i] = SceneManager.LoadSceneAsync(m_AdditionalLevelsMobile[i], LoadSceneMode.Additive);
            additionalScenes[i].allowSceneActivation = false;
            while (additionalScenes[i].progress < 0.9f) {
               Debug.Log("Additional scene loading: " + additionalScenes[i].progress.ToString("F4"));
               yield return new WaitForEndOfFrame();
            }
         }

This leads me to wonder if any type of loading ever happens if you set allowSceneActivation to false for an Additive level.

If I simply delay all loading of the additional scenes to when the new “main” scene is loaded, then my scene basically freezes for several seconds as the additional content is loaded up - which basically destroys the point of additive scene loading. So, am I doing something wrong here? Or is this some kind of bug?

I’m using Unity 5.6.0p2.

Pretty sure when the first scene is finished loading, even when activation is off, the previous scene is dumped, so your loading coroutine terminates.

I think you want to either:

  1. mark the object with the above coroutine on it as “Do Not Destroy,” then intentionally destroy it when the loading is all done

or…

  1. load the first scene additively as well, then go hand-destroy the entire previous scene yourself

Hmm, thought the switch didn’t happen until you activated the scene, but I’ll try that and see what happens! Thanks for the suggestion.