0
0
Unityframework~10 mins

Why scenes organize game content in Unity - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to load a scene named "MainMenu" in Unity.

Unity
UnityEngine.SceneManagement.SceneManager.[1]("MainMenu");
Drag options to blanks, or click blank then click option'
ALoadScene
BUnloadScene
CActivateScene
DStartScene
Attempts:
3 left
💡 Hint
Common Mistakes
Using UnloadScene instead of LoadScene.
Trying to activate a scene without loading it first.
2fill in blank
medium

Complete the code to check if a scene named "Level1" is loaded.

Unity
bool isLoaded = UnityEngine.SceneManagement.SceneManager.GetSceneByName("Level1").[1];
Drag options to blanks, or click blank then click option'
AisActive
BisLoaded
CisOpen
DisReady
Attempts:
3 left
💡 Hint
Common Mistakes
Using isActive which means if the scene is active, not loaded.
Using isOpen or isReady which are not valid properties.
3fill in blank
hard

Fix the error in the code to unload a scene named "Tutorial".

Unity
UnityEngine.SceneManagement.SceneManager.[1]("Tutorial");
Drag options to blanks, or click blank then click option'
ACloseScene
BLoadScene
CUnloadScene
DUnloadSceneAsync
Attempts:
3 left
💡 Hint
Common Mistakes
Using UnloadScene which does not exist.
Using LoadScene instead of unloading.
4fill in blank
hard

Fill both blanks to create a dictionary of scene names and their build indexes for scenes loaded.

Unity
var scenes = new Dictionary<string, int> { { [1], [2] } };
Drag options to blanks, or click blank then click option'
AUnityEngine.SceneManagement.SceneManager.GetActiveScene().name
BUnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex
CUnityEngine.SceneManagement.SceneManager.GetSceneAt(0).name
DUnityEngine.SceneManagement.SceneManager.GetSceneAt(0).buildIndex
Attempts:
3 left
💡 Hint
Common Mistakes
Using GetSceneAt(0) which may not be the active scene.
Mixing name and buildIndex from different scene calls.
5fill in blank
hard

Fill all three blanks to create a dictionary using a loop that maps scene names to their build indexes for all loaded scenes.

Unity
var sceneDict = new Dictionary<string, int>(); for(int [3] = 0; [3] < UnityEngine.SceneManagement.SceneManager.sceneCount; [3]++) { sceneDict[[1]] = [2]; }
Drag options to blanks, or click blank then click option'
AUnityEngine.SceneManagement.SceneManager.GetSceneAt(i).name
BUnityEngine.SceneManagement.SceneManager.GetSceneAt(i).buildIndex
Ci
Dindex
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable other than i for the loop without changing all references.
Mixing scene name and buildIndex from different scene calls.