35 lines
685 B
C#
35 lines
685 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Audio;
|
|
|
|
public class SettingsPanel : MonoBehaviour
|
|
{
|
|
public AudioMixerGroup Mixer;
|
|
|
|
private void OnEnable()
|
|
{
|
|
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
|
|
}
|
|
|
|
public void ToggleMusic(bool boolian)
|
|
{
|
|
if (boolian)
|
|
Mixer.audioMixer.SetFloat("MusicVolume", 0);
|
|
else
|
|
Mixer.audioMixer.SetFloat("MusicVolume", -80);
|
|
}
|
|
public void ToggleSound(bool boolian)
|
|
{
|
|
if (boolian)
|
|
Mixer.audioMixer.SetFloat("SoundVolume", 0);
|
|
else
|
|
Mixer.audioMixer.SetFloat("SoundVolume", -80);
|
|
}
|
|
}
|