|
|
|
@ -12,7 +12,7 @@ public class GameManager : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public static GameManager Instance { get; private set; }
|
|
|
|
|
|
|
|
|
|
public GameObject foregroundCanvas;
|
|
|
|
|
public GameObject foregroundCanvas;
|
|
|
|
|
public GameObject backgroundCanvas;
|
|
|
|
|
|
|
|
|
|
public GameObject spriteToFade;
|
|
|
|
@ -67,13 +67,15 @@ public class GameManager : MonoBehaviour
|
|
|
|
|
|
|
|
|
|
private bool paused = false;
|
|
|
|
|
|
|
|
|
|
private bool[] artActivated;
|
|
|
|
|
|
|
|
|
|
void Awake()
|
|
|
|
|
{
|
|
|
|
|
if (Instance == null)
|
|
|
|
|
{
|
|
|
|
|
Instance = this;
|
|
|
|
|
DontDestroyOnLoad(gameObject);
|
|
|
|
|
DontDestroyOnLoad(foregroundCanvas);
|
|
|
|
|
DontDestroyOnLoad(foregroundCanvas);
|
|
|
|
|
DontDestroyOnLoad(backgroundCanvas);
|
|
|
|
|
DontDestroyOnLoad(events);
|
|
|
|
|
DontDestroyOnLoad(player);
|
|
|
|
@ -81,7 +83,7 @@ public class GameManager : MonoBehaviour
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Destroy(gameObject);
|
|
|
|
|
Destroy(foregroundCanvas);
|
|
|
|
|
Destroy(foregroundCanvas);
|
|
|
|
|
Destroy(backgroundCanvas);
|
|
|
|
|
|
|
|
|
|
Destroy(events);
|
|
|
|
@ -100,6 +102,13 @@ public class GameManager : MonoBehaviour
|
|
|
|
|
sound = GetComponent<AudioSource>();
|
|
|
|
|
enabledArt = new bool[art.Length];
|
|
|
|
|
//GameManager.Instance.enablePowerup(3);
|
|
|
|
|
//GameManager.Instance.enablePowerup(3);
|
|
|
|
|
artActivated = new bool[art.Length];
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < art.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
artActivated[i] = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
@ -173,9 +182,9 @@ public class GameManager : MonoBehaviour
|
|
|
|
|
public void HideDialog()
|
|
|
|
|
{
|
|
|
|
|
dialogBox.SetActive(false);
|
|
|
|
|
artImage.SetActive(false);
|
|
|
|
|
//hideGalleryButton.SetActive(false);
|
|
|
|
|
|
|
|
|
|
artImage.SetActive(false);
|
|
|
|
|
//hideGalleryButton.SetActive(false);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -189,7 +198,7 @@ public class GameManager : MonoBehaviour
|
|
|
|
|
healthbar.SetActive(true);
|
|
|
|
|
powerUps.SetActive(true);
|
|
|
|
|
pauseButton.SetActive(true);
|
|
|
|
|
disableAllPowerups();
|
|
|
|
|
disableAllPowerups();
|
|
|
|
|
player.SetActive(true);
|
|
|
|
|
LoadLevel(sceneToLoad, positionToLoad);
|
|
|
|
|
title.GetComponent<TextMeshProUGUI>().text = "Paused";
|
|
|
|
@ -308,9 +317,9 @@ public class GameManager : MonoBehaviour
|
|
|
|
|
healthbar.SetActive(false);
|
|
|
|
|
powerUps.SetActive(false);
|
|
|
|
|
HideDialog();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool isPaused()
|
|
|
|
|