Class ClientUIAudio
Plays one-shot interface sounds — button clicks, confirmations, refusals — on the Interface channel.
public static class ClientUIAudio
- Inheritance
-
ClientUIAudio
- Inherited Members
Remarks
The first consumer of the interface channel. Until now nothing in the client owned an UnityEngine.AudioSource, so the player's Interface slider adjusted nothing. This owns one: a single 2D source on a persistent host object, scaled by ChannelAudioSource so the slider and the mute-when-unfocused rule apply to it like any other channel.
A UI panel that wants a sound assigns a clip to a serialized field and calls Play(AudioClip, float). A null clip is a no-op rather than an error, because an unassigned clip is the normal state of a project that has not recorded that sound yet.
Methods
Play(AudioClip, float)
Plays a clip once at the interface channel's volume.
public static void Play(AudioClip clip, float volume = 1)
Parameters
clipAudioClipThe clip. Null plays nothing.
volumefloatAuthored volume, 0..1, before the channel scale.