Esempio n. 1
0
        private PoolableAudioSource PlayOn(ResourcePool <PoolableAudioSource> channel, AudioClip clip, bool loop, bool randomizePitch)
        {
            var slot = channel.GetFreeSlot();

            if (randomizePitch)
            {
                float pitch = UnityEngine.Random.Range(_config.MinPitch, _config.MaxPitch);
                slot.Play(clip, loop, pitch);
            }
            else
            {
                slot.Play(clip, loop);
            }

            return(slot);
        }