/// <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); }
/// <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); }
/// <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)); }
/// <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); }
/// <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)); }