示例#1
0
        public static bool EnsureWorldAmbientSoundCreated()
        {
            SoundRoot soundRoot = Find.SoundRoot;

            if (null != soundRoot)
            {
                SustainerManager sManager = soundRoot.sustainerManager;
                if (null != sManager)
                {
                    SoundDef aSpace = SoundDefOf.Ambient_Space;
                    if (null != aSpace)
                    {
                        lock (sManager.AllSustainers)
                        {
                            if (sManager.SustainerExists(aSpace))
                            {
                                return(false);
                            }
                            else
                            {
                                aSpace.TrySpawnSustainer(SoundInfo.OnCamera());
                            }
                        }
                    }
                }
            }
            return(false);
        }
示例#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);
     }
 }
示例#3
0
        public static void SustainerManagerUpdateAllSustainerScopes()
        {
            SoundRoot soundRoot = Find.SoundRoot;

            if (soundRoot == null)
            {
                Log.Error("SoundRoot is null");
                return;
            }
            SustainerManager sustainerManager = soundRoot.sustainerManager;

            if (sustainerManager == null)
            {
                Log.Error("SustainerManager is null");
                return;
            }
            sustainerManager.UpdateAllSustainerScopes();
        }
示例#4
0
        public static void SustainerManagerRegisterSustainer(Sustainer sustainer)
        {
            SoundRoot soundRoot = Find.SoundRoot;

            if (soundRoot == null)
            {
                Log.Error("SoundRoot is null");
                return;
            }
            SustainerManager sustainerManager = soundRoot.sustainerManager;

            if (sustainerManager == null)
            {
                Log.Error("SustainerManager is null");
                return;
            }
            sustainerManager.RegisterSustainer(sustainer);
        }
示例#5
0
 private void <Start> m__0()
 {
     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();
     }
 }
示例#6
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);
     }
 }
示例#7
0
        public virtual void Start()
        {
            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();
            }
        }