Finish pause menu

This commit is contained in:
2025-06-02 15:24:17 -07:00
parent 937db0caa1
commit 2a32db692b
2 changed files with 1075 additions and 8 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -6,14 +6,29 @@ public class GamePlayerPauseMenu : MonoBehaviour
public Button backButton;
public Button continueButton;
public AudioSource songLoop;
public Slider musicSlider;
public Slider sfxSlider;
void Awake()
{
musicSlider.value = PlayerPrefs.GetFloat("musicVolume", 1f);
sfxSlider.value = PlayerPrefs.GetFloat("sfxVolume", 1f);
backButton.onClick.AddListener(() =>
{
UnityEngine.SceneManagement.SceneManager.LoadSceneAsync("MainMenu");
});
continueButton.onClick.AddListener(Unpause);
musicSlider.onValueChanged.AddListener((float value) =>
{
PlayerPrefs.SetFloat("musicVolume", value);
PlayerPrefs.Save();
songLoop.volume = value;
});
sfxSlider.onValueChanged.AddListener((float value) =>
{
PlayerPrefs.SetFloat("sfxVolume", value);
PlayerPrefs.Save();
});
}
void Update()