Update
This commit is contained in:
@ -4,10 +4,8 @@ MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- MainMenuPanel: {fileID: 8730269676052092079, guid: 95c270678e350c64e9b476d7f28a859d,
|
||||
type: 3}
|
||||
- SettingsMenuPanel: {fileID: 7135312091190565530, guid: 09acfb5a6df9ae1458aea9c3923a799b,
|
||||
type: 3}
|
||||
- MainMenuPanel: {instanceID: 0}
|
||||
- SettingsMenuPanel: {instanceID: 0}
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,9 @@ guid: 0f70ad7df61e46f4193f65c69cff1ce8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
defaultReferences:
|
||||
- audioMixer: {fileID: 24100000, guid: 5a3abbd28329b73439a81ec45b2d1906, type: 2}
|
||||
- volumeSlider: {instanceID: 0}
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
|
Reference in New Issue
Block a user