Day 25 — Managing your scenes

using UnityEngine.SceneManagement;
private bool _isGameOver = false;
void Update()
{
if (Input.GetKeyDown(KeyCode.R) && _isGameOver == true)
{
SceneManager.LoadScene(0);
}
}
public void GameOver()
{
_isGameOver = true;
}
_gameManager = GameObject.Find("GameManager").GetComponent<GameManager>();

Adding a Main Menu

First let’s create a new scene by using File > New Scene and then spruce this scene to your liking and remember that if you can add a background colour by switching the Clear Flags option in your main camera to Solid Color.

using UnityEnging.SceneManagementpublic void LoadGame()
{
SceneManager.LoadScene(0);
}

--

--

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
Connor Fullarton

Connor Fullarton

Hey and welcome! My name is Connor and my goal here is to put out a daily post for a full year about my game development journey.