-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain_menu.cs
More file actions
56 lines (53 loc) · 1.46 KB
/
Main_menu.cs
File metadata and controls
56 lines (53 loc) · 1.46 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
52
53
54
55
56
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class Main_menu : MonoBehaviour
{
public Button level2;
public Button level3;
public Button level4;
public Button level5;
public Button level6;
public Button level7;
public Button level8;
int levelComplete;
private void Start()
{
levelComplete = PlayerPrefs.GetInt("levelComplete");
level2.interactable = false;
level3.interactable = false;
level4.interactable = false;
level5.interactable = false;
level6.interactable = false;
level7.interactable = false;
level8.interactable = false;
switch (levelComplete)
{
case 4:
level2.interactable = true;
break;
case 5:
level2.interactable = true;
level3.interactable = true;
break;
case 6:
level2.interactable = true;
level3.interactable = true;
level4.interactable = false;
break;
}
}
public void LoadTo(int level)
{
SceneManager.LoadScene(level);
}
public void Reset()
{
level2.interactable = false;
level3.interactable = false;
level4.interactable = false;
PlayerPrefs.DeleteAll();
}
}