private void InvokeWillLoadActions(List <string> sceneNames, SceneType sceneType)
        {
            foreach (string sceneName in sceneNames)
            {   // Announce scenes individually regardless of type
                OnWillLoadScene?.Invoke(sceneName);
            }

            switch (sceneType)
            {
            case SceneType.Content:
                // Announce content as a set
                OnWillLoadContent?.Invoke(sceneNames);
                break;

            case SceneType.Lighting:
                // We only handle lighting scenes one at a time
                Debug.Assert(sceneNames.Count == 1);
                OnWillLoadLighting?.Invoke(sceneNames[0]);
                break;

            default:
                // Don't announce other types of scenes invidually
                break;
            }
        }
Exemplo n.º 2
0
        private void InvokeWillLoadActions(List <string> sceneNames, SceneType sceneType)
        {
            try
            {
                foreach (string sceneName in sceneNames)
                {   // Announce scenes individually regardless of type
                    OnWillLoadScene?.Invoke(sceneName);
                }

                switch (sceneType)
                {
                case SceneType.Content:
                    // Announce content as a set
                    OnWillLoadContent?.Invoke(sceneNames);
                    break;

                case SceneType.Lighting:
                    // We only handle lighting scenes one at a time
                    Debug.Assert(sceneNames.Count == 1);
                    OnWillLoadLighting?.Invoke(sceneNames[0]);
                    break;

                default:
                    // Don't announce other types of scenes invidually
                    break;
                }
            }
            catch (Exception e)
            {
                Debug.LogError("Error when attempting to invoke will load actions for " + string.Join(", ", sceneNames));
                Debug.LogException(e);
            }
        }