示例#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);
         }
     }
 }
示例#2
0
 protected override void ProcessStateEventInfo(IManagedStateEventInfo info)
 {
     // If we encountered an update event from setup mode, it means we're "ready"
     if (InitializationState == EInitializationState.Setup &&
         info.Type == ManagedStateEventType.StateUpdate)
     {
         InitializationState = EInitializationState.Ready;
         // And we can unload scenes we don't want to keep
         DoUnloadScenes();
     }
     info.Process(this);
 }
示例#3
0
 protected virtual void ProcessStateEventInfo(IManagedStateEventInfo info)
 {
     info.Process(this);
 }
示例#4
0
 /// <summary>
 /// Verifies and returns whether the managed state info should be processed
 /// </summary>
 /// <exception cref="Exception">
 /// Thrown if the info's state verification fails
 /// </exception>
 protected virtual void VerifyStateEventInfo(IManagedStateEventInfo info)
 {
     info.Verify(this);
 }