I’m trying to load an additive scene and move it next to my current scene. So the script I made does this but the screen flickers briefly of the loading screen.
private IEnumerator _loadScene(string name, Level.LOCATIONS level)
{
scene[name].Add(STATE.original, new AdditiveScene((GameObject[])UnityEngine.Object.FindObjectsOfType(typeof(GameObject))));
foreach (GameObject go in scene[name][STATE.original].objectsInScene)
{
if (go.transform.parent == null)
{
go.transform.position = go.transform.position + new Vector3(5000, 0, 0) ;
}
}
yield return Application.LoadLevelAdditiveAsync((int)level);
scene[name].Add(STATE.modified, new AdditiveScene(CompareList(scene[name][STATE.original], new AdditiveScene((GameObject[])UnityEngine.Object.FindObjectsOfType(typeof(GameObject)))).objectsInScene.ToArray()));
foreach (GameObject go in scene[name][STATE.modified].objectsInScene)
{
if(go.GetComponent<Camera>())
go.active = false;
}
}
The code is set up now to move the current scene over and then load the new scene, but even then I still see a flicker. Anyone have any input?