public void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { if (SceneManager.GetActiveScene().buildIndex == 0) { Application.Quit(); } SceneSwitcher.LoadNewScene(0); } }
// private bool _isFrist = true; public void Awake() { DontDestroyOnLoad(this); if (Instance == null) { Instance = this; } else { Destroy(gameObject); } _ourImage = GetComponent <Image>(); _ourImage.enabled = false; }