public void RequestChangeApplicationMode(ApplicationMode mode) { if (m_ChangingMode) { Debug.LogError("Can't change mode while changing other"); return; } m_ChangingMode = true; m_NewApplicationMode = mode; List <SceneReference> sceneReferencesForMode = m_ModeScenes[mode]; m_SceneReferencesToLoad = sceneReferencesForMode .Where(reference => !m_RunningScenes.Any(data => data.HasSameScene(reference))) .ToList(); m_SceneDatasToInitialize = new List <SceneData>(); m_SceneDatasToUnload = m_RunningScenes .Where(data => !sceneReferencesForMode.Any(data.HasSameScene)) .ToList(); m_ScenesToLoadCount = m_SceneReferencesToLoad.Count(); foreach (SceneReference sceneReference in m_SceneReferencesToLoad) { SceneData.CreateAsync(sceneReference, OnSceneLoaded); } }