public static AudioSequence Play(string request, params IEditModule[] edits)
public static AudioSequence Play(string request, float? volume = 1f, float? pitch = 1f, params IEditModule[] edits)
string request |
The key for the group to be played. |
---|---|
params IEditModule[] edits |
An array of edits to apply to the clip. Is defines as params, so the elements do not needs to be in an array when defined. |
string request |
The key for the group to be played. |
---|---|
float volume |
The volume to set the clip to. |
float pitch |
The pitch to set the clip to. |
params IEditModule[] edits |
An array of edits to apply to the clip. Is defines as params, so the elements do not needs to be in an array when defined. |
AudioSequence
The audio sequence that the clip is being played on.
Sets up an AudioSequence
to play with all the options provided and plays it when ready. Returning the AudioSequence
its playing from for you to use should you need the reference.
private void OnEnable()
{
// Plays the clip with no user edits.
AudioManager.Play("MyClip");
// Plays the clip with edits to volume.
AudioManager.Play("MyClip", .5f);
// Plays the clip with edits to volume via edit modules.
AudioManager.Play("MyClip", new VolumeEdit(.5f));
}