Ejemplo n.º 1
0
        IEnumerator WaitUntilClipEnd_Co()
        {
            yield return(new WaitUntil(() => !audioSource.isPlaying));

            OnClipEnded?.Invoke();
            _playingAudionCoroutine = null;
        }
Ejemplo n.º 2
0
 public void Stop()
 {
     AudioClipName = string.Empty;
     audioSource.Stop();
     audioSource.clip = null;
     OnClipEnded?.Invoke();
     OnClipStop?.Invoke();
     if (_playingAudionCoroutine == null)
     {
         return;
     }
     StopCoroutine(WaitUntilClipEnd_Co());
     _playingAudionCoroutine = null;
 }