/
MainMenu.cs
36 lines (32 loc) · 893 Bytes
/
MainMenu.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
using UnityEngine;
using System.Collections;
public class MainMenu : MonoBehaviour {
public GUISkin customSkin;
private enum GUIState { Main, Instructions };
private GUIState currentState = GUIState.Main;
void OnGUI()
{
GUI.skin = customSkin;
switch(currentState)
{
case GUIState.Main:
GUI.Label(new Rect(342.5f, 60f, 595f, 58f), "", "Black Friday Title");
if(GUI.Button(new Rect(534f, 240f, 212f, 58f), "", "Play Button"))
{
Application.LoadLevel("Game");
}
if(GUI.Button(new Rect(349f, 360f, 582f, 58f), "", "Instructions Button"))
{
currentState = GUIState.Instructions;
}
break;
case GUIState.Instructions:
GUI.Label(new Rect(168f, 40f, 944f, 576f), "", "Instructions Text");
if(GUI.Button(new Rect(566.5f, 660f, 147f, 39f), "", "Back Button"))
{
currentState = GUIState.Main;
}
break;
}
}
}