Description
The MasterVolume
property represents the global volume level for all sounds in the application. It is a static property, meaning it applies universally across all instances and is not tied to any specific object. The volume is expressed as a float
value, typically ranging from 0.0 (muted) to 1.0 (maximum volume), although the exact range may vary depending on the implementation.
Usage
To adjust the master volume of the application, set the MasterVolume
property to a desired float
value. This will affect the playback volume of all sounds globally.
Example usage:
// Set the master volume to 50%
Sound.MasterVolume = 0.5f;
// Mute all sounds
Sound.MasterVolume = 0.0f;
// Set the master volume to maximum
Sound.MasterVolume = 1.0f;
Example
// Set the master volume to 50%
Sound.MasterVolume = 0.5f;
// Mute all sounds
Sound.MasterVolume = 0.0f;
// Set the master volume to maximum
Sound.MasterVolume = 1.0f;