Good day to all. Faced such a problem, when I go to the stage with the game, the scene of the main me remains open. Script go to the scene:
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class LoadLevel : MonoBehaviour { public Button LoadButton; void Start() { Button btn = LoadButton.GetComponent<Button>(); btn.onClick.AddListener(TaskOnClick); } void TaskOnClick() { Debug.Log("Loading"); Debug.Log("QuitingScene"); Application.Quit(); //здесь пытаюсь закрыть сцену LoadGame(); Debug.Log("Load!!"); } void LoadGame() { SceneManager.LoadScene("main", LoadSceneMode.Additive); } } Actually the question:
You can help, suggest or push on how to close the previous scene ..
Thank you in advance!