Exemple #1
0
        /// <summary>
        /// Plays a sound effect with random pitch without taking position into account. Also, sound is not destroyed on scene load,
        /// as long as the SoundManager isn't destroyed either.
        /// </summary>
        /// <param name="sfx">Sound Effect to be played.</param>
        /// <param name="volume"></param>
        /// <param name="randomPitchRange">A range to be played between the pitch</param>
        /// <param name="loop"></param>
        /// <param name="delay">Delay time waited before playing.</param>
        public void PlayNonDiegeticRandomPitchSound(AudioClip sfx, float volume = 1f, float randomPitchRange = .1f, bool loop = false, float delay = 0f)
        {
            var sound = new SoundItem(sfx, uiAudioMixer, volume, randomPitchRange, 0f, loop);

            m_SoundsPool.Trigger(SOUND_OBJECT_POOL, Vector3.zero, delay, sound);
        }