-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHowTo.cs
58 lines (49 loc) · 1.51 KB
/
HowTo.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
using UnityEngine;
using System.Collections;
public class HowTo : MonoBehaviour {
public GUIStyle[] MenuStyle = new GUIStyle[2];
public GUIStyle[] Buttons = new GUIStyle[2];
private bool nextPage;
// Use this for initialization
void Start () {
resetHowTo();
}
// Update is called once per frame
void OnGUI () {
if (!nextPage)
First_Page();
else
Second_Page();
}
private void First_Page()
{
GUI.Label(new Rect(0,0,Screen.width,Screen.height),"",MenuStyle[0]);
if (GUI.Button(new Rect(1100,550,200,200),"",Buttons[0]))
{
nextPage = true;
}
if (GUI.Button(new Rect(25,550,200,200),"",Buttons[1]))
{
Application.LoadLevel("StartMenu");
}
}
private void Second_Page()
{
GUI.Label(new Rect(0,0,Screen.width,Screen.height),"",MenuStyle[1]);
if (GUI.Button(new Rect(25,550,200,200),"",Buttons[1]))
{
nextPage = false;
}
}
private void resetHowTo()
{
MenuStyle[0].normal.background = (Texture2D)Resources.Load("Cubilism_HowTo_1");
MenuStyle[1].normal.background = (Texture2D)Resources.Load("Cubilism_HowTo_2");
Buttons[0].normal.background = (Texture2D)Resources.Load("greenCube");
Buttons[0].hover.background = (Texture2D)Resources.Load("greenCubeHover");
Buttons[0].active.background = (Texture2D)Resources.Load("greenCubeSelected");
Buttons[1].normal.background = (Texture2D)Resources.Load("redCube");
Buttons[1].hover.background = (Texture2D)Resources.Load("redCubeHover");
Buttons[1].active.background = (Texture2D)Resources.Load("redCubeSelected");
}
}