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. fileciteturn7file1

Optional UI

  • Slider sfxVolumeSlider
  • Slider musicVolumeSlider

If assigned, they are initialized from saved prefs on Start(). fileciteturn7file1

Persistence Keys

  • MUSIC_VOLUME (default 1f)
  • SFX_VOLUME (default 1f) fileciteturn7file1

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. fileciteturn7file1

Setup Checklist

  1. Define the Music and SFX buses in FMOD (bus:/Music, bus:/SFX).
  2. Wire the sliders’ OnValueChanged to these methods, or call them from your own UI. fileciteturn7file1