-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenuCont.cs
More file actions
51 lines (47 loc) · 1.27 KB
/
menuCont.cs
File metadata and controls
51 lines (47 loc) · 1.27 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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class menuCont : MonoBehaviour
{
public GameObject PlayButton;
public GameObject muteButton;
public GameObject menu;
public GameObject ok;
public GameObject Camera;
public Text SoundButtonText;
public void PlayGame()
{
SceneManager.LoadScene(1);
}
public void GetOptions()
{
PlayButton.SetActive(false);
muteButton.SetActive(true);
menu.SetActive(false);
ok.SetActive(true);
}
public void okey()
{
PlayButton.SetActive(true);
menu.SetActive(true);
ok.SetActive(false);
muteButton.SetActive(false);
}
public void MuteSound()
{
if (Camera.GetComponent<AudioSource>().mute)
{
Camera.GetComponent<AudioSource>().mute = false;
SoundButtonText.text = "Mute Sound";
PlayerPrefs.SetInt("mute", 0);
}
else
{
Camera.GetComponent<AudioSource>().mute = true;
SoundButtonText.text = "Unmute Sound";
PlayerPrefs.SetInt("mute", 1);
}
}
}