-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSettingsMenu.cs
More file actions
97 lines (79 loc) · 2.25 KB
/
SettingsMenu.cs
File metadata and controls
97 lines (79 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.UI;
public class SettingsMenu : MonoBehaviour
{
[SerializeField] private GameObject SettingsMenuUI;
public void OpenSettings() {
SettingsMenuUI.SetActive(true);
}
public void CloseSettings() {
SettingsMenuUI.SetActive(false);
}
/*
[SerializeField] private AudioMixer SFXMixer;
[SerializeField] private AudioMixer BGMMixer;
[SerializeField] private GameObject BGMUnmuted;
[SerializeField] private GameObject BGMMuted;
[SerializeField] private GameObject SFXUnmuted;
[SerializeField] private GameObject SFXMuted;
[SerializeField] private GameObject SFXSlider;
[SerializeField] private GameObject BGMSlider;
private float currVolBGM;
private float currVolSFX;
private bool isBGMMuted = false;
private bool isSFXMuted = false;
private void Start()
{
if(isBGMMuted)
{
BGMMuted.SetActive(true);
BGMUnmuted.SetActive(false);
} else
{
BGMMuted.SetActive(false);
BGMUnmuted.SetActive(true);
}
if (isSFXMuted)
{
SFXMuted.SetActive(true);
SFXUnmuted.SetActive(false);
}
else
{
SFXMuted.SetActive(false);
SFXUnmuted.SetActive(true);
}
}
public void UnmuteBGM()
{
BGMMixer.SetFloat("BGMVolume", Mathf.Log10((float) 0.3) * 20);
BGMMuted.SetActive(false);
BGMUnmuted.SetActive(true);
isBGMMuted = false;
}
public void MuteBGM()
{
BGMMixer.SetFloat("BGMVolume", Mathf.Log10((float) 0.001) * 20);
BGMMuted.SetActive(true);
BGMUnmuted.SetActive(false);
isBGMMuted = true;
}
public void UnmuteSFX()
{
SFXMixer.SetFloat("SFXVol", Mathf.Log10((float) 0.6) * 20);
SFXMuted.SetActive(false);
SFXUnmuted.SetActive(true);
isSFXMuted = false;
}
public void MuteSFX()
{
SFXMixer.SetFloat("SFXVol", Mathf.Log10((float)0.001) * 20);
SFXMuted.SetActive(true);
SFXUnmuted.SetActive(false);
isSFXMuted = true;
}
*/
}