Esempio n. 1
0
 public void FadeIn(float duration, ExtendedAudioSource source = null)
 {
     if (source == null)
     {
         source = AudioPool.GetAudioSource();
     }
     source.Setup(this);
     source.FadeIn(duration);
 }
Esempio n. 2
0
 public void PlayDelayed(float delay, ExtendedAudioSource source = null)
 {
     if (source == null)
     {
         source = AudioPool.GetAudioSource();
     }
     source.Setup(this);
     source.PlayDelayed(delay);
 }
Esempio n. 3
0
        public void Pause(ExtendedAudioSource source = null)
        {
            if (source == null)
            {
                source = AudioPool.GetAudioSource();
            }

            source.Pause();
        }
Esempio n. 4
0
 public void PlayOnce(ExtendedAudioSource source = null)
 {
     if (source == null)
     {
         source = AudioPool.GetAudioSource();
     }
     source.Setup(this);
     source.PlayOnce();
 }
Esempio n. 5
0
 public void Stop(ExtendedAudioSource source = null)
 {
     //Get audiosource
     if (source == null)
     {
         source = AudioPool.GetAudioSource();
     }
     source.Stop();
 }
Esempio n. 6
0
        public void Play(ExtendedAudioSource source = null)
        {
            //Get audiosource
            if (source == null)
            {
                source = AudioPool.GetAudioSource();
            }

            source.Setup(this);
            source.Play();
        }
Esempio n. 7
0
        private void Awake()
        {
            if (Instance == null)
            {
                Instance = this;
                DontDestroyOnLoad(gameObject);
            }
            else
            {
                Destroy(gameObject);
            }

            pool = GetComponent <AudioPool>();
        }
Esempio n. 8
0
        public void Update()
        {
            if (isPaused)
            {
                return;
            }

            if (!source.isPlaying)
            {
                AudioPool.ReturnToPool(this);
            }
            else
            {
                isPlaying = true;
            }
        }