Exemplo n.º 1
0
 protected override void VerifyStateEventInfo(
     IManagedStateEventInfo info)
 {
     try
     {
         info.Verify(this);
     }
     catch (AggregateException aggregate_ex)
     {
         var inner_exceptions = new List <Exception>();
         foreach (var ex in aggregate_ex.InnerExceptions)
         {
             var redundant_ex = ex as RedundantSceneException;
             if (redundant_ex != null)
             {
                 // If we are only unloading unused scenes, don't mind
                 // the scenes already being loaded during setup
                 if (SkipAlreadyLoadedScenes)
                 {
                     // Don't unload this scene because it is supposed to be loaded
                     ScenesToUnloadAtStart.Remove(redundant_ex.SceneName);
                     Debug.Log("Keeping " + redundant_ex.SceneName);
                 }
             }
             else
             {
                 inner_exceptions.Add(ex);
             }
         }
         if (inner_exceptions.Any())
         {
             throw new AggregateException("Could not verify event info", aggregate_ex);
         }
     }
 }
Exemplo n.º 2
0
 private void DoUnloadScenes()
 {
     if (!ScenesToUnloadAtStart.Any())
     {
         return;
     }
     EnqueueUnloadScenes(ScenesToUnloadAtStart);
 }
Exemplo n.º 3
0
 private IEnumerable ClearScenesToUnload()
 {
     ScenesToUnloadAtStart.Clear();
     yield return(null);
 }