예제 #1
0
        protected void DoExit(ControlledStateManager manager)
        {
            var scene_names_to_unload = FirstScenesExitUnload
                                        .Concat(SecondScenesExitUnload)
                                        .ToArray();

            manager.EnqueueCoroutine(OnStateExitCoroutine(scene_names_to_unload).GetEnumerator());
        }
예제 #2
0
        protected void DoVerifyExit()
        {
            var scene_names_to_unload = FirstScenesExitUnload
                                        .Concat(SecondScenesExitUnload)
                                        .ToArray();
            // Verify that the scenes to be unloaded are valid before enqueing the unloader coroutine
            var inner_exceptions = new List <Exception>();

            foreach (var scene_name in scene_names_to_unload)
            {
                if (!Application.CanStreamedLevelBeLoaded(scene_name))
                {
                    inner_exceptions.Add(new ArgumentException(
                                             "Scene cannot not be unloaded: \"" + scene_name + "\""));
                }
            }
            if (inner_exceptions.Any())
            {
                throw new AggregateException("Could not verify exit", inner_exceptions.ToArray());
            }
        }