IEnumerator WaitUntilClipEnd_Co() { yield return(new WaitUntil(() => !audioSource.isPlaying)); OnClipEnded?.Invoke(); _playingAudionCoroutine = null; }
public void Stop() { AudioClipName = string.Empty; audioSource.Stop(); audioSource.clip = null; OnClipEnded?.Invoke(); OnClipStop?.Invoke(); if (_playingAudionCoroutine == null) { return; } StopCoroutine(WaitUntilClipEnd_Co()); _playingAudionCoroutine = null; }