Lade till knappar efter det att spelet är klart
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
@@ -7,4 +8,13 @@ public class SceneLoader : MonoBehaviour {
|
||||
public void LoadScene() {
|
||||
SceneManager.LoadScene(sceneName);
|
||||
}
|
||||
public void Quit() {
|
||||
// Stänger spelet när det körs som en byggd applikation
|
||||
Application.Quit();
|
||||
|
||||
// Stänger spelaren i editorn
|
||||
#if UNITY_EDITOR
|
||||
EditorApplication.isPlaying = false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user