Summary - Scene management
- Game Development course
- Intermediate
- Lesson 60/83
- 4 min
Reinforce scene management usage with a summary task.
Summary: Scene Management System
In this module, you mastered all phases of professional scene management. Build Settings orders scene assets; SceneManager.LoadScene handles standard switches, while Additive mode layers multi-scene setups.
// Scene Management Workflow Summary:
// 1. Build Settings: Scenes In Build (Index 0, 1, 2)
// 2. SceneManager.LoadScene("Level1", LoadSceneMode.Single/Additive)
// 3. DontDestroyOnLoad(GameManager)
// 4. SceneManager.LoadSceneAsync -> Loading Screen ProgressDontDestroyOnLoad keeps manager data alive across levels, and LoadSceneAsync powers smooth, freeze-free loading screens.
Practice Print complete scene management profile
Define index (0), scene ("MainMenu"), and mode ("Async"). Print Index: 0 | Scene: MainMenu | Mode: Async to the console.
Starter code
using System;
class Program
{
static void Main()
{
// index, scene ve mode değerlerini tanımlayıp yazdır
}
}Sample solution
using System;
class Program
{
static void Main()
{
int index = 0;
string scene = "MainMenu";
string mode = "Async";
Console.WriteLine("Index: " + index + " | Scene: " + scene + " | Mode: " + mode);
}
}Expected output
Index: 0 | Scene: MainMenu | Mode: Async
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Which statement regarding scene transitions and object persistence in the Scene management system is correct?
- When Additive mode is used, the old scene is forcibly deleted and DontDestroyOnLoad fails.
- LoadSceneAsync is exclusively a mixer function used to load audio assets.
- Scenes must reside in Build Settings; DontDestroyOnLoad preserves objects, and LoadSceneAsync loads in the background. Correct answer
- Adding a scene to Build Settings is not necessary for loading; the file name alone suffices.
Explanation: Scenes must be registered in the build list; persistent entities rely on DontDestroyOnLoad and background streaming uses LoadSceneAsync.
2 Load scene in single mode
SceneManager.LoadScene(0, LoadSceneMode.____);
SceneManager.LoadScene(0, LoadSceneMode.Single);
Explanation: Single mode is used to unload the old scene and load solely the target scene.
3 Scene management general summary
| Term | Meaning |
|---|---|
Build Settings |
Settings window for scene build indexes |
SceneManager.LoadScene |
Core API method for scene transition |
DontDestroyOnLoad |
Keeps object from transition cleanup |
LoadSceneAsync |
Async background loading without freeze |