浏览代码

Fix for issue Location Loader issue #229

/main
jandd661 4 年前
当前提交
8a7a3b44
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 5
      UOP1_Project/Assets/Scripts/SceneManagement/LocationLoader.cs

5
UOP1_Project/Assets/Scripts/SceneManagement/LocationLoader.cs


if (!CheckLoadState(currentSceneName))
{
//Add the scene to the list of scenes to load asynchronously in the background
_scenesToLoadAsyncOperations.Add(SceneManager.LoadSceneAsync(currentSceneName, LoadSceneMode.Additive));
_scenesToLoadAsyncOperations.Add(SceneManager.LoadSceneAsync(currentSceneName, LoadSceneMode.Single));
}
}
_scenesToLoadAsyncOperations[0].completed += SetActiveScene;

Scene scene = SceneManager.GetSceneAt(i);
if (scene.name != _initializationScene.sceneName)
{
Debug.Log("Added scene to unload = " + scene.name);
//Add the scene to the list of the scenes to unload
_ScenesToUnload.Add(scene);
}

//Unload the scene asynchronously in the background
SceneManager.UnloadSceneAsync(_ScenesToUnload[i]);
}
_ScenesToUnload.Clear();
_ScenesToUnload.Clear();
}
/// <summary> This function checks if a scene is already loaded </summary>

正在加载...
取消
保存