Example #1
0
 private static void RunEventFromAnotherThread(Action action)
 {
     CultureInfoUtility.EnsureEnglish();
     try
     {
         if (action != null)
         {
             action();
         }
     }
     catch (Exception ex)
     {
         Log.Error("Exception from asynchronous event: " + ex, false);
         try
         {
             if (LongEventHandler.currentEvent != null && LongEventHandler.currentEvent.exceptionHandler != null)
             {
                 LongEventHandler.currentEvent.exceptionHandler(ex);
             }
         }
         catch (Exception arg)
         {
             Log.Error("Exception was thrown while trying to handle exception. Exception: " + arg, false);
         }
     }
 }
Example #2
0
 public virtual void Start()
 {
     try
     {
         CultureInfoUtility.EnsureEnglish();
         Current.Notify_LoadedSceneChanged();
         CheckGlobalInit();
         Action action = delegate
         {
             DeepProfiler.Start("Misc Init (InitializingInterface)");
             try
             {
                 soundRoot = new SoundRoot();
                 if (GenScene.InPlayScene)
                 {
                     uiRoot = new UIRoot_Play();
                 }
                 else if (GenScene.InEntryScene)
                 {
                     uiRoot = new UIRoot_Entry();
                 }
                 uiRoot.Init();
                 Messages.Notify_LoadedLevelChanged();
                 if (Current.SubcameraDriver != null)
                 {
                     Current.SubcameraDriver.Init();
                 }
             }
             finally
             {
                 DeepProfiler.End();
             }
         };
         if (!PlayDataLoader.Loaded)
         {
             Application.runInBackground = true;
             LongEventHandler.QueueLongEvent(delegate
             {
                 PlayDataLoader.LoadAllPlayData();
             }, null, doAsynchronously: true, null);
             LongEventHandler.QueueLongEvent(action, "InitializingInterface", doAsynchronously: false, null);
         }
         else
         {
             action();
         }
     }
     catch (Exception arg)
     {
         Log.Error("Critical error in root Start(): " + arg);
     }
 }
Example #3
0
 public virtual void Start()
 {
     try
     {
         CultureInfoUtility.EnsureEnglish();
         Current.Notify_LoadedSceneChanged();
         Root.CheckGlobalInit();
         Action action = delegate
         {
             this.soundRoot = new SoundRoot();
             if (GenScene.InPlayScene)
             {
                 this.uiRoot = new UIRoot_Play();
             }
             else if (GenScene.InEntryScene)
             {
                 this.uiRoot = new UIRoot_Entry();
             }
             this.uiRoot.Init();
             Messages.Notify_LoadedLevelChanged();
             if (Current.SubcameraDriver != null)
             {
                 Current.SubcameraDriver.Init();
             }
         };
         if (!PlayDataLoader.Loaded)
         {
             LongEventHandler.QueueLongEvent(delegate
             {
                 PlayDataLoader.LoadAllPlayData(false);
             }, null, true, null);
             LongEventHandler.QueueLongEvent(action, "InitializingInterface", false, null);
         }
         else
         {
             action();
         }
     }
     catch (Exception arg)
     {
         Log.Error("Critical error in root Start(): " + arg, false);
     }
 }