0
0
Unityframework~10 mins

Scene loading and unloading in Unity - Interactive Code Practice

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 "GameScene" using Unity's SceneManager.

Unity
SceneManager.[1]("GameScene");
Drag options to blanks, or click blank then click option'
AUnloadSceneAsync
BLoadScene
CLoadSceneAsyncAdditive
DGetActiveScene
Attempts:
3 left
💡 Hint
Common Mistakes
Using UnloadSceneAsync instead of LoadScene.
Confusing synchronous and asynchronous loading methods.
2fill in blank
medium

Complete the code to unload a scene named "MenuScene" asynchronously.

Unity
SceneManager.[1]("MenuScene");
Drag options to blanks, or click blank then click option'
ALoadScene
BGetSceneByName
CUnloadSceneAsync
DLoadSceneAsync
Attempts:
3 left
💡 Hint
Common Mistakes
Using LoadScene instead of unloading.
Using synchronous unload methods which don't exist.
3fill in blank
hard

Fix the error in the code to load a scene additively named "Level2".

Unity
SceneManager.LoadScene("Level2", [1].Additive);
Drag options to blanks, or click blank then click option'
ALoadSceneMode
BSceneLoadMode
CSceneManagerMode
DLoadMode
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect enum names like SceneLoadMode.
Forgetting to specify additive mode.
4fill in blank
hard

Fill both blanks to load a scene named "BonusLevel" asynchronously and additively.

Unity
SceneManager.[1]("BonusLevel", [2].Additive);
Drag options to blanks, or click blank then click option'
ALoadSceneAsync
BLoadScene
CLoadSceneMode
DUnloadSceneAsync
Attempts:
3 left
💡 Hint
Common Mistakes
Using synchronous LoadScene instead of LoadSceneAsync.
Using wrong enum like UnloadSceneAsync.
5fill in blank
hard

Fill all three blanks to unload a scene named "OldScene" asynchronously and check if unloading is done.

Unity
AsyncOperation asyncOp = SceneManager.[1]("OldScene");
if (asyncOp.[2])
{
    Debug.Log("Scene unloaded successfully.");
}
else
{
    Debug.Log("Scene is still unloading.");
}
asyncOp.[3] += () => Debug.Log("Unload completed event triggered.");
Drag options to blanks, or click blank then click option'
AUnloadSceneAsync
BisDone
Ccompleted
DLoadSceneAsync
Attempts:
3 left
💡 Hint
Common Mistakes
Using LoadSceneAsync instead of UnloadSceneAsync.
Checking wrong property instead of isDone.
Not subscribing to the completed event properly.