Пример #1
0
 public void PlayDelayed(float delay, ExtendedAudioSource source = null)
 {
     if (source == null)
     {
         source = AudioPool.GetAudioSource();
     }
     source.Setup(this);
     source.PlayDelayed(delay);
 }
Пример #2
0
 public void FadeIn(float duration, ExtendedAudioSource source = null)
 {
     if (source == null)
     {
         source = AudioPool.GetAudioSource();
     }
     source.Setup(this);
     source.FadeIn(duration);
 }
Пример #3
0
        public void Pause(ExtendedAudioSource source = null)
        {
            if (source == null)
            {
                source = AudioPool.GetAudioSource();
            }

            source.Pause();
        }
Пример #4
0
 public void Stop(ExtendedAudioSource source = null)
 {
     //Get audiosource
     if (source == null)
     {
         source = AudioPool.GetAudioSource();
     }
     source.Stop();
 }
Пример #5
0
        public static void FadeOut(Audio audio, float duration)
        {
            ExtendedAudioSource source = pool.IsPlaying(audio);

            if (source != null)
            {
                audio.FadeOut(duration, source);
            }
        }
Пример #6
0
 public void PlayOnce(ExtendedAudioSource source = null)
 {
     if (source == null)
     {
         source = AudioPool.GetAudioSource();
     }
     source.Setup(this);
     source.PlayOnce();
 }
Пример #7
0
        public void Play(ExtendedAudioSource source = null)
        {
            //Get audiosource
            if (source == null)
            {
                source = AudioPool.GetAudioSource();
            }

            source.Setup(this);
            source.Play();
        }
Пример #8
0
 public static void AudioEndPlaying(ExtendedAudioSource source)
 {
     OnAudioEndPlaying?.Invoke(source);
 }
Пример #9
0
 public void FadeOut(float duration, ExtendedAudioSource source = null)
 {
     source.FadeOut(duration);
 }
Пример #10
0
 public void Resume(ExtendedAudioSource source)
 {
     source.Resume();
 }
Пример #11
0
 void End(ExtendedAudioSource endSource)
 {
     endSource.Reset();
 }
Пример #12
0
 public static void Resume(Audio audio, ExtendedAudioSource source)
 {
     audio.Resume(source);
 }
Пример #13
0
 public static void Pause(Audio audio, ExtendedAudioSource source)
 {
     audio.Pause(source);
 }
Пример #14
0
 public static void ReturnToPool(ExtendedAudioSource extendedAudioSource)
 {
     AudioEvents.AudioEndPlaying(extendedAudioSource);
     activeAudioSources.Remove(extendedAudioSource);
     extendedAudioSource.gameObject.SetActive(false);
 }
Пример #15
0
 public static void PauseAudio(ExtendedAudioSource source)
 {
     OnPauseAudio?.Invoke(source);
 }
Пример #16
0
 public static void ResumeAudio(ExtendedAudioSource source)
 {
     OnResumeAudio?.Invoke(source);
 }
Пример #17
0
 public void OnEnable()
 {
     previewer = EditorUtility
                 .CreateGameObjectWithHideFlags("Audio preview", HideFlags.HideAndDontSave, typeof(ExtendedAudioSource))
                 .GetComponent <ExtendedAudioSource>();
 }