28 lines
579 B
C#
28 lines
579 B
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
public class SaveMusicSettings : MonoBehaviour
|
||
|
{
|
||
|
[SerializeField] private Slider musicSlider = null;
|
||
|
|
||
|
private void Start()
|
||
|
{
|
||
|
LoadValues();
|
||
|
}
|
||
|
|
||
|
public void SaveVolumeButton()
|
||
|
{
|
||
|
float musicValue = musicSlider.value;
|
||
|
PlayerPrefs.SetFloat("MusicValue", musicValue);
|
||
|
LoadValues();
|
||
|
}
|
||
|
|
||
|
void LoadValues()
|
||
|
{
|
||
|
float musicValue = PlayerPrefs.GetFloat("MusicValue");
|
||
|
musicSlider.value = musicValue;
|
||
|
}
|
||
|
}
|