Complete the code to load a scene named "MainMenu" in Unity.
UnityEngine.SceneManagement.SceneManager.[1]("MainMenu");
The method LoadScene is used to load a new scene in Unity.
Complete the code to check if a scene named "Level1" is loaded.
bool isLoaded = UnityEngine.SceneManagement.SceneManager.GetSceneByName("Level1").[1];
The property isLoaded tells if a scene is currently loaded in Unity.
Fix the error in the code to unload a scene named "Tutorial".
UnityEngine.SceneManagement.SceneManager.[1]("Tutorial");
To unload a scene in Unity, use UnloadSceneAsync because unloading is asynchronous.
Fill both blanks to create a dictionary of scene names and their build indexes for scenes loaded.
var scenes = new Dictionary<string, int> { { [1], [2] } };Use GetActiveScene().name for the scene name and GetActiveScene().buildIndex for its build index.
Fill all three blanks to create a dictionary using a loop that maps scene names to their build indexes for all loaded scenes.
var sceneDict = new Dictionary<string, int>(); for(int [3] = 0; [3] < UnityEngine.SceneManagement.SceneManager.sceneCount; [3]++) { sceneDict[[1]] = [2]; }
Use GetSceneAt(i).name and GetSceneAt(i).buildIndex inside a loop with variable i to build the dictionary.