-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainMenuScript01.cs
76 lines (62 loc) · 1.56 KB
/
MainMenuScript01.cs
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
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
//using UnityEngine.SceneManagement;
public class MainMenuScript01 : MonoBehaviour
{
private AudioSource Audio;
public Slider VolumeSlider;
private ShowMenu ShowMenu;
void Awake()
{
ShowMenu = GetComponent<ShowMenu>();
Audio = GetComponent<AudioSource>();
}
//From here downwards are scripts so that when pressing the a button is will hide the previous menu and bring up a new one
//Some have actual functions like level01 will load the first level
public void Level01 (string scene1)
{
Application.LoadLevel(1);
// SceneManager.LoadScene(1);
}
public void MainMenu()
{
Application.LoadLevel(0);
}
public void Quit()
{
Application.Quit();
}
public void Options()
{
ShowMenu.ShowOptions();
ShowMenu.HideMainMenu();
}
public void Keybindings()
{
ShowMenu.ShowKeybindings();
ShowMenu.HideOptions();
}
public void OptionsBackButton()
{
ShowMenu.HideOptions();
ShowMenu.ShowMainMenu();
}
public void KeybindBackButton()
{
ShowMenu.HideKeybindings();
ShowMenu.ShowOptions();
}
//These two allow for the control for the volume and mute button
public void ChangeVolume()
{
Audio.volume = VolumeSlider.value;
}
public void MuteVolume()
{
if (Audio.mute == true)
Audio.mute = false;
else
Audio.mute = true;
}
}