Scripting / Audio
SoundManager
Singleton (DontDestroyOnLoad, execution order −100) that persists AudioMixer volume settings across sessions. On startup it reads all saved parameters and applies them to the mixer automatically.
Inspector Variables
| Field | Type | Description |
|---|---|---|
audioMixer | AudioMixer | The AudioMixer asset whose exposed parameters this manager controls. Must be assigned on the prefab. |
Static Properties
| Property | Type | Description |
|---|---|---|
current | SoundManager | Singleton instance. Available after Start() runs on the first scene. |
Public Methods
| Method | Description |
|---|---|
Set(string parameterName, float value) | Applies value to the named AudioMixer parameter, updates the in-memory save data, and writes to disk. The parameter name must exactly match an exposed parameter in the AudioMixer asset (case-sensitive). |
// Change music volume programmatically SoundManager.current.Set("MusicVolume", -10f); // Mute SFX SoundManager.current.Set("SFXVolume", -80f);
Setup guide
See Audio Setup in the Manual for how to expose AudioMixer parameters and configure the SoundManager prefab in your scene.