Пример #1
0
 public AudioClip GetAudio(ClipID id)
 {
     foreach (ClipRef reference in allAudios)
     {
         if (reference.id == id)
         {
             return(reference.clip);
         }
     }
     Debug.Log("SoundManager error: Could not find a ClipRef with that Id.");
     return(null);
 }
Пример #2
0
 public void PlaySound(ClipID id)
 {
     if (!primarySFXSound.isPlaying)
     {
         primarySFXSound.clip = GetAudio(id);
         primarySFXSound.Play();
     }
     else
     {
         if (!secondarySFXSound.isPlaying)
         {
             secondarySFXSound.clip = GetAudio(id);
             secondarySFXSound.Play();
         }
     }
 }
Пример #3
0
 public void PlayBGSound(ClipID id)
 {
     BGsound.clip = GetAudio(id);
     BGsound.Play();
     BGsound.loop = true;
 }