private void OnValueChanged(float volume) { if (ignoreValueChanged) { return; } switch (audioType) { case AudioType.Music: AudioClipPlayer.SetMusicVolume(volume); break; case AudioType.Sfx: AudioClipPlayer.SetSfxVolume(volume); break; default: throw new ArgumentOutOfRangeException(); } PlayerSettings.Save(); }