Beispiel #1
0
    public void playSfx(AudioClip soundClip, float volume, SoundInterruptType interruptType, List <string> alsoInterrupt, string dontInterrupt)
    {
        if (!muteAllSound && !muteSfx)
        {
            switch (interruptType)
            {
            case SoundInterruptType.DontCare:
                play(soundClip, volume);
                break;

            case SoundInterruptType.DontInterrupt:
                playClipOnlyIfSimilarNotPlaying(soundClip, dontInterrupt, volume);
                break;

            case SoundInterruptType.Interrupt:
                stopPlayingSoundList(alsoInterrupt, soundClip.name);
                play(soundClip, volume);
                break;

            case SoundInterruptType.DontInterruptButInterruptOthers:
                stopPlayingSoundList(alsoInterrupt);
                playClipOnlyIfSimilarNotPlaying(soundClip, dontInterrupt, volume);
                break;
            }
        }
    }
Beispiel #2
0
    public void playSfx(string clipName, float volume, SoundInterruptType interruptType, string[] alsoInterrupt)
    {
#if !REMOVE_AUDIO
        AudioClip theClip = findAudioInListByName(clipName, sfxClips);

        if (theClip == defaultClip)        //if we cant find the audio in list by that name, attempt to find the closest possible
        {
            theClip = findClosestAudioInListByName(clipName);
        }

        if (interruptType == SoundInterruptType.DontInterrupt || interruptType == SoundInterruptType.DontInterruptButInterruptOthers)
        {
            playSfx(theClip, volume, interruptType, new List <string>(alsoInterrupt), clipName);
        }
        else
        {
            playSfx(theClip, volume, interruptType, new List <string>(alsoInterrupt));
        }
#endif
    }
Beispiel #3
0
 public void playSfx(AudioClip soundClip, float volume, SoundInterruptType interruptType, List <string> alsoInterrupt)
 {
     playSfx(soundClip, volume, interruptType, alsoInterrupt, "");
 }
Beispiel #4
0
 public void playSfx(AudioClip soundClip, float volume, SoundInterruptType interruptType, string[] alsoInterrupt)
 {
     playSfx(soundClip, volume, SoundInterruptType.DontCare, new List <string>(alsoInterrupt));
 }
Beispiel #5
0
 public void playSfx(string clipName, float volume, SoundInterruptType interruptType)
 {
     playSfx(clipName, volume, interruptType, new string[0]);
 }
 public void playSfx(AudioClip soundClip, float volume, SoundInterruptType interruptType, List<string> alsoInterrupt, string dontInterrupt)
 {
     if(!muteAllSound && !muteSfx)
     {
         switch(interruptType)
         {
         case SoundInterruptType.DontCare:
             play(soundClip, volume);
             break;
         case SoundInterruptType.DontInterrupt:
             playClipOnlyIfSimilarNotPlaying(soundClip, dontInterrupt, volume);
             break;
         case SoundInterruptType.Interrupt:
             stopPlayingSoundList(alsoInterrupt, soundClip.name);
             play(soundClip, volume);
             break;
         case SoundInterruptType.DontInterruptButInterruptOthers:
             stopPlayingSoundList(alsoInterrupt);
             playClipOnlyIfSimilarNotPlaying(soundClip, dontInterrupt, volume);
             break;
         }
     }
 }
 public void playSfx(AudioClip soundClip, float volume, SoundInterruptType interruptType, List<string> alsoInterrupt)
 {
     playSfx(soundClip, volume, interruptType, alsoInterrupt, "");
 }
 public void playSfx(AudioClip soundClip, float volume, SoundInterruptType interruptType, string[] alsoInterrupt)
 {
     playSfx(soundClip, volume, SoundInterruptType.DontCare, new List<string>(alsoInterrupt));
 }
    public void playSfx(string clipName, float volume, SoundInterruptType interruptType, string[] alsoInterrupt)
    {
        #if !REMOVE_AUDIO
        AudioClip theClip = findAudioInListByName(clipName, sfxClips);

        if(theClip == defaultClip) //if we cant find the audio in list by that name, attempt to find the closest possible
        {
            theClip = findClosestAudioInListByName(clipName);
        }

        if(interruptType == SoundInterruptType.DontInterrupt || interruptType == SoundInterruptType.DontInterruptButInterruptOthers)
        {
            playSfx(theClip, volume, interruptType, new List<string>(alsoInterrupt), clipName);
        }
        else
        {
            playSfx(theClip, volume, interruptType, new List<string>(alsoInterrupt));
        }

        #endif
    }
 public void playSfx(string clipName, float volume, SoundInterruptType interruptType)
 {
     playSfx(clipName, volume, interruptType, new string[0]);
 }