private void InvokeLoadedActions(List <string> sceneNames, SceneType sceneType) { foreach (string sceneName in sceneNames) { // Announce scenes individually regardless of type OnSceneLoaded?.Invoke(sceneName); } switch (sceneType) { case SceneType.Content: // Announce content as a set OnContentLoaded?.Invoke(sceneNames); break; case SceneType.Lighting: // We only handle lighting scenes one at a time Debug.Assert(sceneNames.Count == 1); OnLightingLoaded?.Invoke(sceneNames[0]); break; default: // Don't announce other types of scenes invidually break; } }
private void InvokeLoadedActions(List <string> sceneNames, SceneType sceneType) { try { foreach (string sceneName in sceneNames) { // Announce scenes individually regardless of type OnSceneLoaded?.Invoke(sceneName); } switch (sceneType) { case SceneType.Content: // Announce content as a set OnContentLoaded?.Invoke(sceneNames); break; case SceneType.Lighting: // We only handle lighting scenes one at a time Debug.Assert(sceneNames.Count == 1); OnLightingLoaded?.Invoke(sceneNames[0]); break; default: // Don't announce other types of scenes invidually break; } } catch (Exception e) { Debug.LogError("Error when attempting to invoke loaded actions for " + string.Join(", ", sceneNames)); Debug.LogException(e); } }