Ejemplo n.º 1
0
        /// <summary>
        /// Plays the audio clip at the specified position.
        /// </summary>
        /// <param name="position">The position that the audio clip should be played at.</param>
        /// <param name="clipIndex">The index of the AudioClip that should be played.</param>
        /// <returns>The result of playing the AudioClip.</returns>
        public PlayResult PlayAtPosition(Vector3 position, int clipIndex)
        {
            var audioClipConfig = GetAudioClipInfo(clipIndex);

            m_LastPlayResult = AudioManager.PlayAtPosition(audioClipConfig.AudioClip, audioClipConfig.AudioConfig, position);
            return(m_LastPlayResult);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Plays the audio clip with a random set index.
        /// </summary>
        /// <param name="gameObject">The GameObject that is playing the audio clip.</param>
        /// <param name="audioModifier">The AudioModifier that should override the AudioSource settings.</param>
        /// <param name="clipIndex">The index of the AudioClip that should be played.</param>
        /// <returns>The result of playing the AudioClip.</returns>
        public PlayResult PlayAudioClip(GameObject gameObject, AudioModifier audioModifier, int clipIndex = -1)
        {
            var audioClipInfo = GetAudioClipInfo(clipIndex);

            audioClipInfo    = new AudioClipInfo(audioClipInfo, audioModifier);
            m_LastPlayResult = AudioManager.Play(gameObject, audioClipInfo);
            return(m_LastPlayResult);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Internal method which stops any playing audio on the specified GameObject and AudioConfig.
 /// </summary>
 /// <param name="playGameObject">The GameObject to stop the audio on.</param>
 /// <param name="playResult">The PlayResult from when the audio was played.</param>
 private AudioSource StopInternal(GameObject playGameObject, PlayResult playResult)
 {
     return(m_AudioManagerModule.Stop(playGameObject, playResult));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Stops playing the audio on the specified GameObject.
 /// </summary>
 /// <param name="gameObject">The GameObject to stop the audio on.</param>
 /// <param name="playResult">The result AudioClip and AudioConfig that was played.</param>
 public void Stop(GameObject gameObject, PlayResult playResult)
 {
     AudioManager.Stop(gameObject, playResult);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Internal method which stops any playing audio on the specified GameObject and AudioConfig.
 /// </summary>
 /// <param name="gameObject">The GameObject to stop the audio on.</param>
 /// <param name="playResult">The PlayResult from when the audio was played.</param>
 public static AudioSource Stop(GameObject gameObject, PlayResult playResult)
 {
     return(Instance.StopInternal(gameObject, playResult));
 }