示例#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>();
 }