Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (38 sloc) 1.06 KB
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class MenuManager : MonoBehaviour
{
[SerializeField]
Text Version;
private void Awake() {
if (Version != null) {
Version.text = "Ver: " + Application.version;
}
QualitySettings.vSyncCount = PlayerPrefs.GetInt("vSync", 1);
}
public void Activate(GameObject Object)
{
Object.SetActive(true);
}
public void Deactivate(GameObject Object)
{
Object.SetActive(false);
}
public void ChangeLevel(string LevelName)
{
/* if (Application.CanStreamedLevelBeLoaded(LevelName)){
SceneManager.LoadScene(LevelName);
}else{
SceneManager.LoadScene("error");
}*/
try { GameObject.Find("SceneFader").GetComponent<FadeScript>().FadeToLevel(LevelName); }
catch { SceneManager.LoadScene(LevelName); }
}
public void ApplicationQuit()
{
Application.Quit();
}
}
You can’t perform that action at this time.