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); }
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); } }
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(); }
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); }
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(); } }
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); } }
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(); } }