MusicParametersManager
Overview
Controls global Music and SFX volumes by writing directly to FMOD buses and persisting sliders to PlayerPrefs. On boot, restores the last-saved values and updates both bus volumes and optional UI sliders. fileciteturn7file1
Optional UI
- Slider
sfxVolumeSlider - Slider
musicVolumeSlider
If assigned, they are initialized from saved prefs on Start(). fileciteturn7file1
Persistence Keys
MUSIC_VOLUME(default1f)SFX_VOLUME(default1f) fileciteturn7file1
API
public void ChangeMusicVolume(float volume); // bus:/Music
public void ChangeSFXVolume(float volume); // bus:/SFX
Both methods update the corresponding FMOD bus via RuntimeManager.GetBus(...).setVolume(volume) and store the value in PlayerPrefs. fileciteturn7file1
Setup Checklist
- Define the Music and SFX buses in FMOD (
bus:/Music,bus:/SFX). - Wire the sliders’ OnValueChanged to these methods, or call them from your own UI. fileciteturn7file1