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 MainMenu : MonoBehaviour
- {
- public int backmenu;
- public void LoadScene(int sceneIndex)
- {
- SceneManager.LoadScene(sceneIndex);
- }
- public void Exit()
- {
- Application.Quit();
- }
- protected virtual void Update()
- {
- if (Input.GetKeyDown(KeyCode.Escape) && SceneManager.GetActiveScene().buildIndex !=backmenu) LoadScene(backmenu);
- }
- }
Add Comment
Please, Sign In to add comment