Beispiel #1
0
 IEnumerator ManageLoop(AudioSource source, LoopGroup group, EffectFader fader)
 {
     while (true)
     {
         fader.Update(Time.deltaTime);
         source.volume = fader.Value * group.VolumeRange.x;
         yield return(null);
     }
 }
Beispiel #2
0
        public void PlayClip(LoopGroup group, EffectFader fader)
        {
            AudioSource source = Pool.Grab();

            source.clip = group.LoopedAudio;

            source.pitch  = group.PitchRange.x;
            source.volume = group.VolumeRange.x;
            source.loop   = true;

            source.Play();
            StartCoroutine(ManageLoop(source, group, fader));
        }
Beispiel #3
0
 public static void Play(LoopGroup group, EffectFader fader)
 {
     instance.PlayClip(group, fader);
 }