jump-game/Jump Game/Assets/Scripts/Menu/SettingsMenu.cs
Christer Warén e15e813614 Update
2022-04-01 08:47:42 +03:00

22 lines
563 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.UI;
public class SettingsMenu : MonoBehaviour
{
public AudioMixer audioMixer;
public Slider volumeSlider;
void Start(){
volumeSlider.value = PlayerPrefs.GetFloat("volume", -0.30f);
audioMixer.SetFloat("volume", PlayerPrefs.GetFloat("volume", -0.30f));
}
public void setVolume (float volume){
PlayerPrefs.SetFloat("volume", volume);
audioMixer.SetFloat("volume", volume);
}
}