2025-12-13 18:18:28 +08:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
2025-12-26 11:15:56 +08:00
|
|
|
public class UIHome_BY_SettingPanel : SubUIBase
|
2025-12-13 18:18:28 +08:00
|
|
|
{
|
|
|
|
|
public Button btn_ExitGame;
|
|
|
|
|
public Slider slider_AudioMusic;
|
|
|
|
|
public Slider slider_AudioEffect;
|
|
|
|
|
public override void Awake()
|
|
|
|
|
{
|
|
|
|
|
base.Awake();
|
|
|
|
|
|
|
|
|
|
btn_ExitGame.onClick.AddListener(() =>
|
|
|
|
|
{
|
|
|
|
|
Application.Quit();
|
|
|
|
|
});
|
|
|
|
|
slider_AudioMusic.value = PlayerPrefs.GetFloat("AudioMusic");
|
|
|
|
|
slider_AudioEffect.value = PlayerPrefs.GetFloat("AudioEffect");
|
|
|
|
|
slider_AudioMusic.onValueChanged.AddListener((a) =>
|
|
|
|
|
{
|
|
|
|
|
PlayerPrefs.SetFloat("AudioMusic", a);
|
|
|
|
|
PlayerPrefs.Save();
|
|
|
|
|
});
|
|
|
|
|
slider_AudioEffect.onValueChanged.AddListener((a) =>
|
|
|
|
|
{
|
|
|
|
|
PlayerPrefs.SetFloat("AudioEffect", a);
|
|
|
|
|
PlayerPrefs.Save();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|