private void LoadNextScene() { ICollection <object> data = null; if (currentScene != null) { data = currentScene.ExportData(); currentScene.OnEnd(); currentScene.Unload(); if (!currentScene.AlwaysActive) { activeScenes.RemoveIfExists(currentScene); } } currentScene = nextSceneToLoad; nextSceneToLoad = null; activeScenes.AddIfMissing(currentScene); currentScene.InternalLoad(); currentScene.ImportData(data); currentScene.OnStart(); isLoading = false; useLoadingScreen = false; }