Beispiel #1
0
    private IEnumerator Stop_(float fadeT)
    {
        // Locks any fade attempt while execution this.
        waitLock = true;
        // All stems fades out and stop.
        foreach (AudioSource audio in audioPlayers)
        {
            fader.FadeOutAndStop(audio, fadeT);
        }
        // Waits for the fade time to pass.
        yield return(new WaitForSeconds(fadeT));

        // Resets all values, which means the stems are not playing.
        ResetValues();
    }