Esempio n. 1
0
 public void PauseZone(string zoneName)
 {
     JuniperSystem.OnMainThread(() =>
     {
         var audioSources = Find.All <AudioSource>(a => !a.CompareTag(INTERACTION_SOUND_TAG));
         foreach (var audioSource in audioSources)
         {
             if (audioSource.IsInZone(zoneName) &&
                 audioSource.isPlaying)
             {
                 audioSource.Pause();
             }
         }
     });
 }
Esempio n. 2
0
 public void PlayZone(string zoneName)
 {
     JuniperSystem.OnMainThread(() =>
     {
         var audioSources = Find.All <AudioSource>(a => !a.CompareTag(INTERACTION_SOUND_TAG));
         foreach (var audioSource in audioSources)
         {
             if (!audioSource.IsInZone(zoneName) &&
                 audioSource.isPlaying)
             {
                 audioSource.Stop();
             }
             else if (audioSource.playOnAwake &&
                      !audioSource.isPlaying)
             {
                 audioSource.Activate();
                 audioSource.Play();
             }
         }
     });
 }