ExitGame.cs 491 B

12345678910111213141516171819202122232425
  1. using UnityEngine;
  2. using UnityEngine.SceneManagement;
  3. public class ExitGame : MonoBehaviour
  4. {
  5. [SerializeField]
  6. private string sceneToLoad = "LightGlueScene";
  7. // Start is called before the first frame update
  8. void Start()
  9. {
  10. }
  11. // Update is called once per frame
  12. void Update()
  13. {
  14. }
  15. // Load the configured scene (can be set from the Inspector)
  16. public void onExitGame()
  17. {
  18. SceneManager.LoadScene(sceneToLoad);
  19. }
  20. }