PlaySoundsUI
How do I use Play Sounds U I
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
47 | public void PlaySoundsUI(bool buttonSound) | 1 |
108 | sounds.PlaySoundsUI(false); | 2 |
118 | sounds.PlaySoundsUI(false); | 3 |
128 | sounds.PlaySoundsUI(true); | 4 |
141 | sounds.PlaySoundsUI(true); | 5 |
150 | sounds.PlaySoundsUI(true); | 6 |
File name: SoundManager.cs
Copy
47 public void PlaySoundsUI(bool buttonSound)
48 {
49 if (SystemScr.mute)
50 return;
51 if (buttonSound)
52 audSources[2].clip = button;
53 else
54 audSources[2].clip = pause;
55
56 audSources[2].Play();
57 }
File name: UIgame.cs
Copy
100 public void Pause_btn()
101 {
102 if (SystemScr.paused)
103 {
104 Resume_btn();
105 }
106 else
107 {
108 sounds.PlaySoundsUI(false);
109
110 SystemScr.Pause(true);
111 GameScreen.SetActive(false);
112 PauseScreen.SetActive(true);
113 }
114 }
File name: UIgame.cs
Copy
116 public void Resume_btn()
117 {
118 sounds.PlaySoundsUI(false);
119
120 SystemScr.Pause(false);
121 GameScreen.SetActive(true);
122 PauseScreen.SetActive(false);
123 OptionsScreen.SetActive(false);
124 }
File name: UIgame.cs
Copy
126 public void Options_btn()
127 {
128 sounds.PlaySoundsUI(true);
129
130 OptionsScreen.SetActive(true);
131 }
File name: UIgame.cs
Copy
139 public void ExitFromOptions_btn()
140 {
141 sounds.PlaySoundsUI(true);
142
143 OptionsScreen.SetActive(false);
144 }
File name: UIgame.cs
Copy
146 public void Mute_btn()
147 {
148 if (SystemScr.mute)
149 {
150 sounds.PlaySoundsUI(true);
151
152 muteText.text = "OFF";
153 SystemScr.mute = false;
154
155 sounds.PlayMusic(true);
156 }
157 else
158 {
159 muteText.text = "ON";
160 SystemScr.mute = true;
161
162 sounds.PlayMusic(false);
163 }
164 }
PlaySoundsUI 128 lượt xem
Gõ tìm kiếm nhanh...