using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class SaveSoundSettings : MonoBehaviour { [SerializeField] private Slider volumeSlider = null; private void Start() { LoadValues(); } public void SaveVolumeButton() { float volumeValue = volumeSlider.value; PlayerPrefs.SetFloat("VolumeValue", volumeValue); LoadValues(); } void LoadValues() { float volumeValue = PlayerPrefs.GetFloat("VolumeValue"); volumeSlider.value = volumeValue; } }