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