LazyBot/Assets/Scripts/Audio/AudioContainer.cs
/// <summary>
/// Stops playback of audio after delay.
/// </summary>
/// <param name="audioName">Audio name to be played.</param>
/// <param name="delay">Delay of stopping.</param>
/// <param name="audioKey">MD5 hash key of audio.</param>
/// <param name="searchInNested">Search in child containers.</param>
/// <param name="onlyDirect">Only direct childs.</param>
/// <returns>Is audio was found and stop is executable.</returns>
Stops playback of audio after delay.
Stops playback of audio after delay .
public bool StopDelayed(string audioName, float delay, string audioKey, bool searchInNested = true, bool onlyDirect = true)
        {
            for (int i = 0; i < _audios.Count; i++)
            {
                if (_audios[i].Name == audioName)
                {
                    return StopDelayed(i, delay, audioKey);
                }
            }
            if (!searchInNested) return false;
            for (int i = 0; i < _containers.Count; i++)
            {
                if (_containers[i].StopDelayed(audioName, delay, audioKey, !onlyDirect, false))
                {
                    return true;
                }
            }
            return false;
        }
public bool StopDelayed ( string audioName , float delay , string audioKey , bool searchInNested = true , bool onlyDirect = true ) { for ( int i = 0 ; i < _audios . Count ; i ++ ) { if ( _audios [ i ] . Name == audioName ) { return StopDelayed ( i , delay , audioKey ) ; } } if ( ! searchInNested ) return false ; for ( int i = 0 ; i < _containers . Count ; i ++ ) { if ( _containers [ i ] . StopDelayed ( audioName , delay , audioKey , ! onlyDirect , false ) ) { return true ; } } return false ; }
Stops playback of audio after delay.
Stops playback of audio after delay .
None
audioName
string
Audio name to be played.
Audio name to be played .
delay
float
Delay of stopping.
Delay of stopping .
audioKey
string
MD5 hash key of audio.
MD5 hash key of audio .
searchInNested
bool
Search in child containers.
Search in child containers .
onlyDirect
bool
Only direct childs.
Only direct childs .