mirror of
https://github.com/frizbee19/FebGameJam.git
synced 2026-11-11 04:22:40 +00:00
Audio Settings
This commit is contained in:
1 parent
4a942a73fb
commit
4ee32def84
8 files changed
+3659
-51
No files matched your search
@@ -0,0 +1,26 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
public class AudioManager : MonoBehaviour
|
||||
{
|
||||
|
||||
public AudioMixer theMixer;
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (PlayerPrefs.HasKey("MasterVol"))
|
||||
{
|
||||
theMixer.SetFloat("MasterVol", PlayerPrefs.GetFloat("MasterVol"));
|
||||
}
|
||||
if (PlayerPrefs.HasKey("MusicVol"))
|
||||
{
|
||||
theMixer.SetFloat("MusicVol", PlayerPrefs.GetFloat("MusicVol"));
|
||||
}
|
||||
if (PlayerPrefs.HasKey("SFXVol"))
|
||||
{
|
||||
theMixer.SetFloat("SFXVol", PlayerPrefs.GetFloat("SFXVol"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user