Beispiel #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);
        }