Ejemplo n.º 1
0
 private void OnDisable()
 {
     if (_stopOnDisable)
     {
         StopCoroutine(_coroutine);
         _handle.Stop();
     }
 }
Ejemplo n.º 2
0
        private static IEnumerator StopAfterInternal(AudioHandle handle, float time)
        {
#if EDITOR_COROUTINES && UNITY_EDITOR
            if (!Application.isPlaying)
            {
                yield return(new EditorWaitForSeconds(time));
            }
            else
            {
                yield return(new WaitForSeconds(time));
            }
#else
            yield return(new WaitForSeconds(time));
#endif
            handle.Stop(0);
        }
Ejemplo n.º 3
0
        private static async UniTask StopAfterInternal(AudioHandle handle, float time)
        {
            await UniTask.Delay((int)(time * 1000));

            handle.Stop(0);
        }