Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.SceneManagement;
- public class LevelManager : MonoBehaviour {
- private static LevelManager instance = null;
- private PauseMenu pauseMenu;
- // Use this for initialization
- void Awake () {
- pauseMenu = FindObjectOfType<PauseMenu>();
- if (instance == null)
- {
- instance = this;
- }else if(instance != null)
- {
- Destroy(gameObject);
- }
- DontDestroyOnLoad(gameObject);
- }
- // Update is called once per frame
- void Update () {
- }
- public void LoadLevel(string name)
- {
- pauseMenu.SetPaused(false);
- SceneManager.LoadScene(name);
- }
- public void LoadLevel(int name)
- {
- pauseMenu.SetPaused(false);
- SceneManager.LoadScene(name);
- }
- //Tf do you think it does?
- public void RestartLevel()
- {
- SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
- }
- //Quits the application.. duh
- public void Quit()
- {
- Debug.Log("Quit!");
- Application.Quit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement