public void SampleOneShotManagerUpdate()
 {
     for (int i = 0; i < this.samples.Count; i++)
     {
         this.samples[i].Update();
     }
     this.cleanupList.Clear();
     for (int j = 0; j < this.samples.Count; j++)
     {
         SampleOneShot sampleOneShot = this.samples[j];
         if (sampleOneShot.source == null || !sampleOneShot.source.isPlaying || !SoundDefHelper.CorrectContextNow(sampleOneShot.subDef.parentDef, sampleOneShot.Map))
         {
             if (sampleOneShot.source != null && sampleOneShot.source.isPlaying)
             {
                 sampleOneShot.source.Stop();
             }
             sampleOneShot.SampleCleanup();
             this.cleanupList.Add(sampleOneShot);
         }
     }
     if (this.cleanupList.Count > 0)
     {
         this.samples.RemoveAll((SampleOneShot s) => this.cleanupList.Contains(s));
     }
 }
 public void SampleOneShotManagerUpdate()
 {
     for (int i = 0; i < samples.Count; i++)
     {
         samples[i].Update();
     }
     cleanupList.Clear();
     for (int j = 0; j < samples.Count; j++)
     {
         SampleOneShot sampleOneShot = samples[j];
         if (sampleOneShot.source == null || (!sampleOneShot.source.isPlaying && (!sampleOneShot.subDef.tempoAffectedByGameSpeed || !Find.TickManager.Paused)) || !SoundDefHelper.CorrectContextNow(sampleOneShot.subDef.parentDef, sampleOneShot.Map))
         {
             if (sampleOneShot.source != null && sampleOneShot.source.isPlaying)
             {
                 sampleOneShot.source.Stop();
             }
             sampleOneShot.SampleCleanup();
             cleanupList.Add(sampleOneShot);
         }
     }
     if (cleanupList.Count > 0)
     {
         samples.RemoveAll((SampleOneShot s) => cleanupList.Contains(s));
     }
 }