Complete the code to open the Unity Editor's Console window.
EditorWindow.GetWindow(typeof([1]));The Console window in Unity Editor is accessed using ConsoleWindow type.
Complete the code to add a menu item in Unity Editor under 'Tools' menu.
[MenuItem("Tools/[1]")] static void MyTool() { Debug.Log("Tool activated"); }
The string inside MenuItem attribute defines the menu path and name. Here, 'MyTool' is the menu item name.
Fix the error in the code to correctly create a custom Editor window named 'MyWindow'.
public class MyWindow : EditorWindow { [MenuItem("Window/My Window")] public static void ShowWindow() { var window = GetWindow<[1]>(); window.titleContent = new GUIContent("My Window"); window.Show(); } }
The generic type in GetWindow<> must be the class name of the custom window, here MyWindow.
Fill both blanks to create a dictionary comprehension that maps GameObject names to their active state in the scene.
var activeStates = new Dictionary<string, bool>() {
{ [1], [2] }
};To map names to active states, use gameObject.name as key and gameObject.activeSelf as value.
Fill all three blanks to create a LINQ query that selects names of active GameObjects from a list.
var activeNames = from [1] in gameObjects where [2].activeSelf == [3] select [1].name;
The variable name in the query is obj. We check if obj.activeSelf is true to filter active objects, then select their names.