Consider the following Unity C# script snippet that loads a scene asynchronously:
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneLoader : MonoBehaviour {
void Start() {
SceneManager.LoadSceneAsync("Level2");
Debug.Log("Scene loading started");
}
}What will be printed in the Unity Console when this script runs?
using UnityEngine; using UnityEngine.SceneManagement; public class SceneLoader : MonoBehaviour { void Start() { SceneManager.LoadSceneAsync("Level2"); Debug.Log("Scene loading started"); } }
Remember that LoadSceneAsync starts loading but does not block the thread.
The Debug.Log runs immediately after starting the asynchronous load, so only "Scene loading started" is printed at that moment. The actual scene load completes later without automatic logging.
In Unity, you want to load a new scene but keep the current scene active and loaded. Which method should you use?
Think about how to keep multiple scenes loaded at once.
Using LoadScene with LoadSceneMode.Additive loads the new scene without unloading the current one, allowing multiple scenes to be active simultaneously.
Examine the following code snippet:
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneUnloader : MonoBehaviour {
void Start() {
SceneManager.UnloadSceneAsync("Level1");
Debug.Log("Unload requested");
}
}After running, the scene "Level1" remains loaded. What is the most likely reason?
using UnityEngine; using UnityEngine.SceneManagement; public class SceneUnloader : MonoBehaviour { void Start() { SceneManager.UnloadSceneAsync("Level1"); Debug.Log("Unload requested"); } }
Think about Unity's rules for unloading active scenes.
Unity does not allow unloading the active scene. You must first set another scene as active before unloading the current active scene.
You want to load a scene asynchronously and then print "Scene loaded" only after the scene finishes loading. Which code snippet is correct?
Look for how to detect completion of asynchronous loading.
Option B attaches a callback to the async operation's completed event, ensuring the log runs after loading finishes. Other options either log immediately or misuse properties.
Given the following Unity C# code executed in a project with three scenes: "MainMenu", "Level1", and "Level2". Initially, only "MainMenu" is loaded and active.
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneTest : MonoBehaviour {
void Start() {
SceneManager.LoadScene("Level1", LoadSceneMode.Additive);
SceneManager.LoadSceneAsync("Level2", LoadSceneMode.Additive);
SceneManager.UnloadSceneAsync("MainMenu");
}
}After all operations complete, how many scenes remain loaded?
using UnityEngine; using UnityEngine.SceneManagement; public class SceneTest : MonoBehaviour { void Start() { SceneManager.LoadScene("Level1", LoadSceneMode.Additive); SceneManager.LoadSceneAsync("Level2", LoadSceneMode.Additive); SceneManager.UnloadSceneAsync("MainMenu"); } }
Consider the effect of additive loading and unloading asynchronously.
Initially MainMenu is loaded and active. Level1 loads additively synchronously, adding it. Level2 loads additively asynchronously. UnloadSceneAsync is called on MainMenu, but since it remains the active scene, it cannot be unloaded. After all operations complete, all three scenes remain loaded.