Loading Scenes in Unity

Adding Text Variable ‘_restartText’
Dragging Restart_Text into Corresponding Slot
Note: In order to manage scenes in Unity, you must include the SceneManagement namespace library.
Adding Code to GameManager Script
Note: I named my current scene, "Game". In order to load the scene, I used the name of the scene in the following line: SceneManager.LoadScene("Game");For quicker loading, as Strings are a little slower, you could use the scene number. In this case it would have been written as follows:SceneManager.LoadScene(0);
Adding Code to UIManager Script
Calling GameOver()
Adding Scene to Build Settings
Testing LoadScene

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store