setting up volume

This commit is contained in:
Glence 2023-03-08 16:22:05 +08:00
parent ef7cd4c0c0
commit 6854c41614
2 changed files with 79 additions and 74 deletions

View File

@ -10,7 +10,7 @@ namespace SHADE_Scripting
{ {
static public float cameraSensitivity = 100.0f; static public float cameraSensitivity = 100.0f;
static public float cameraFOV = 90.0f; static public float cameraFOV = 45.0f;
static public float masterVolume = 100.0f; static public float masterVolume = 100.0f;
static public float sfxVolume = 100.0f; static public float sfxVolume = 100.0f;

View File

@ -68,15 +68,20 @@ namespace SHADE_Scripting.UI
if (mv != null) if (mv != null)
{ {
Settings.masterVolume = mv.ScaledValue; Settings.masterVolume = mv.ScaledValue * 0.01f;
SHADE.Audio.SetVCAVolume("vca:/MASTER", Settings.masterVolume);
//Debug.Log($"MASTERee:{SHADE.Audio.GetVCAVolume("vca:/MASTER")} value of master: {mv.ScaledValue * 0.001f}");
} }
if (sfx != null) if (sfx != null)
{ {
Settings.sfxVolume = sfx.ScaledValue; Settings.sfxVolume = sfx.ScaledValue;
SHADE.Audio.SetVCAVolume("vca:/SFX", Settings.sfxVolume);
SHADE.Audio.SetVCAVolume("vca:/UI", Settings.sfxVolume);
} }
if (bgm != null) if (bgm != null)
{ {
Settings.bgmVolume = bgm.ScaledValue; Settings.bgmVolume = bgm.ScaledValue;
SHADE.Audio.SetVCAVolume("vca:/MUSIC", Settings.bgmVolume);
} }
if (fov != null) if (fov != null)
{ {