-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMenuManagerScript.cs
65 lines (63 loc) · 1.52 KB
/
MenuManagerScript.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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class MenuManagerScript : MonoBehaviour
{
public GameObject playScreen, pauseScreen, loseScreen, winScreen;
public void ReturnToMain()
{
loseScreen.SetActive(false);
DataManager.Instance.SaveData();
Time.timeScale = 1;
SceneManager.LoadScene(0);
}
public void PlayButton()
{
Time.timeScale = 1;
SceneManager.LoadScene(1);
DataManager.Instance.credits = 0;
}
public void NextLevel()
{
DataManager.Instance.SaveData();
Time.timeScale = 1;
SceneManager.LoadScene(2);
}
public void PauseButton()
{
Time.timeScale = 0;
playScreen.SetActive(false);
pauseScreen.SetActive(true);
}
public void UnPauseButton()
{
playScreen.SetActive(true);
pauseScreen.SetActive(false);
Time.timeScale = 1;
}
public void HomeButton()
{
DataManager.Instance.SaveData();
SceneManager.LoadScene(0);
Time.timeScale = 1;
}
public void Lose()
{
pauseScreen.SetActive(false);
loseScreen.SetActive(true);
}
public void Win()
{
Time.timeScale = 0;
pauseScreen.SetActive(false);
winScreen.SetActive(true);
}
public void RollCredits()
{
DataManager.Instance.SaveData();
Time.timeScale = 1;
SceneManager.LoadScene(3);
}
}