Finish pause menu
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -6,14 +6,29 @@ public class GamePlayerPauseMenu : MonoBehaviour
|
|||||||
public Button backButton;
|
public Button backButton;
|
||||||
public Button continueButton;
|
public Button continueButton;
|
||||||
public AudioSource songLoop;
|
public AudioSource songLoop;
|
||||||
|
public Slider musicSlider;
|
||||||
|
public Slider sfxSlider;
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
|
musicSlider.value = PlayerPrefs.GetFloat("musicVolume", 1f);
|
||||||
|
sfxSlider.value = PlayerPrefs.GetFloat("sfxVolume", 1f);
|
||||||
backButton.onClick.AddListener(() =>
|
backButton.onClick.AddListener(() =>
|
||||||
{
|
{
|
||||||
UnityEngine.SceneManagement.SceneManager.LoadSceneAsync("MainMenu");
|
UnityEngine.SceneManagement.SceneManager.LoadSceneAsync("MainMenu");
|
||||||
});
|
});
|
||||||
continueButton.onClick.AddListener(Unpause);
|
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()
|
void Update()
|
||||||
|
|||||||
Reference in New Issue
Block a user