Update
This commit is contained in:
@@ -2,16 +2,20 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class SettingsMenu : MonoBehaviour
|
||||
{
|
||||
public AudioMixer audioMixer;
|
||||
|
||||
public void setVolume (float volume){
|
||||
audioMixer.SetFloat("volume", volume);
|
||||
}
|
||||
public Slider volumeSlider;
|
||||
|
||||
void Start(){
|
||||
audioMixer.SetFloat("volume", -30);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user