예제 #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>();
 }