Bird
Raised Fist0
Unityframework~10 mins

Unity Editor interface - Interactive Code Practice

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

Complete the code to open the Unity Editor's Console window.

Unity
EditorWindow.GetWindow(typeof([1]));
Drag options to blanks, or click blank then click option'
AConsoleWindow
BSceneView
CGameView
DInspectorWindow
Attempts:
3 left
💡 Hint
Common Mistakes
Using GameView or SceneView instead of ConsoleWindow.
Forgetting to use typeof() around the window type.
2fill in blank
medium

Complete the code to add a menu item in Unity Editor under 'Tools' menu.

Unity
[MenuItem("Tools/[1]")]
static void MyTool() {
    Debug.Log("Tool activated");
}
Drag options to blanks, or click blank then click option'
AShowInspector
BOpenConsole
CStartGame
DMyTool
Attempts:
3 left
💡 Hint
Common Mistakes
Using names that don't match the method or are invalid menu paths.
Missing the MenuItem attribute.
3fill in blank
hard

Fix the error in the code to correctly create a custom Editor window named 'MyWindow'.

Unity
public class MyWindow : EditorWindow {
    [MenuItem("Window/My Window")]
    public static void ShowWindow() {
        var window = GetWindow<[1]>();
        window.titleContent = new GUIContent("My Window");
        window.Show();
    }
}
Drag options to blanks, or click blank then click option'
AEditorWindow
BMyWindow
CWindow
DMyEditor
Attempts:
3 left
💡 Hint
Common Mistakes
Using EditorWindow instead of the custom class name.
Using a wrong or undefined class name.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps GameObject names to their active state in the scene.

Unity
var activeStates = new Dictionary<string, bool>() {
    { [1], [2] }
};
Drag options to blanks, or click blank then click option'
AgameObject.name
BgameObject.activeSelf
CgameObject.tag
DgameObject.transform
Attempts:
3 left
💡 Hint
Common Mistakes
Using transform or tag instead of name for the key.
Using incorrect property for active state.
5fill in blank
hard

Fill all three blanks to create a LINQ query that selects names of active GameObjects from a list.

Unity
var activeNames = from [1] in gameObjects
                  where [2].activeSelf == [3]
                  select [1].name;
Drag options to blanks, or click blank then click option'
Aobj
Ctrue
DgameObject
Attempts:
3 left
💡 Hint
Common Mistakes
Using inconsistent variable names in the query.
Using false instead of true for filtering active objects.

Practice

(1/5)
1. Which Unity Editor panel shows all the objects currently in your game scene?
easy
A. Project panel
B. Hierarchy panel
C. Inspector panel
D. Console panel

Solution

  1. Step 1: Understand the purpose of the Hierarchy panel

    The Hierarchy panel lists all game objects currently in the active scene, showing their structure and relationships.
  2. Step 2: Compare with other panels

    The Project panel shows assets, Inspector shows details of selected objects, and Console shows messages and errors.
  3. Final Answer:

    Hierarchy panel -> Option B
  4. Quick Check:

    Objects in scene = Hierarchy panel [OK]
Hint: Hierarchy = scene objects list panel [OK]
Common Mistakes:
  • Confusing Project panel with Hierarchy panel
  • Thinking Inspector shows all objects
  • Mixing Console with object lists
2. Which of the following is the correct way to open the Console panel in Unity Editor?
easy
A. Window > General > Console
B. Edit > Console
C. File > Console
D. Assets > Console

Solution

  1. Step 1: Recall Unity Editor menu structure

    The Console panel is accessed via the Window menu, under General, then Console.
  2. Step 2: Verify other options

    Edit, File, and Assets menus do not contain Console panel options.
  3. Final Answer:

    Window > General > Console -> Option A
  4. Quick Check:

    Console panel location = Window > General > Console [OK]
Hint: Console is under Window > General [OK]
Common Mistakes:
  • Looking for Console under Edit or File menus
  • Trying to find Console in Assets menu
  • Assuming Console opens automatically
3. Given this code snippet in a Unity script attached to a GameObject, what will the Inspector panel show for the 'speed' variable after you change it in the script and save?
public class Player : MonoBehaviour {
    public float speed = 5f;
}
medium
A. A slider to adjust speed value
B. No speed variable visible
C. A numeric field showing 5
D. An error message in Console

Solution

  1. Step 1: Understand public variables in Unity scripts

    Public variables like 'speed' appear in the Inspector as editable fields showing their current value.
  2. Step 2: Determine the field type for float

    Floats show as numeric input fields, not sliders by default.
  3. Final Answer:

    A numeric field showing 5 -> Option C
  4. Quick Check:

    Public float = numeric field in Inspector [OK]
Hint: Public float shows numeric field in Inspector [OK]
Common Mistakes:
  • Assuming all floats show sliders
  • Expecting no variable to appear without [SerializeField]
  • Thinking script errors show in Inspector
4. You try to drag a texture from the Project panel to a GameObject in the Scene, but nothing happens. What is the most likely reason?
medium
A. The GameObject does not have a Renderer component
B. The texture is not imported correctly
C. The Console panel is closed
D. The Project panel is locked

Solution

  1. Step 1: Understand how textures apply to GameObjects

    Textures can only be applied to GameObjects with Renderer components (like MeshRenderer) that display materials.
  2. Step 2: Check other options

    Incorrect import would show errors, Console panel state does not affect drag-drop, and Project panel locking does not exist.
  3. Final Answer:

    The GameObject does not have a Renderer component -> Option A
  4. Quick Check:

    Texture drag needs Renderer component [OK]
Hint: GameObject needs Renderer to accept textures [OK]
Common Mistakes:
  • Ignoring Renderer component requirement
  • Thinking Console panel affects drag-drop
  • Assuming Project panel can be locked
5. You want to organize your assets better in the Project panel by creating folders and moving assets inside. Which steps correctly describe how to do this?
hard
A. Folders are created automatically when you import assets; no manual action needed
B. Use the Hierarchy panel to create folders and drag assets there
C. Drag assets directly into the Scene to create folders automatically
D. Right-click in Project panel > Create > Folder, then drag assets into the folder

Solution

  1. Step 1: Create folders in Project panel

    Right-click inside the Project panel and select Create > Folder to make a new folder.
  2. Step 2: Move assets into folders

    Drag and drop assets from the Project panel into the new folder to organize them.
  3. Step 3: Verify incorrect options

    Hierarchy panel manages scene objects, not assets; dragging assets into Scene does not create folders; folders are not auto-created on import.
  4. Final Answer:

    Right-click in Project panel > Create > Folder, then drag assets into the folder -> Option D
  5. Quick Check:

    Create folders in Project panel manually [OK]
Hint: Create folders via right-click in Project panel [OK]
Common Mistakes:
  • Trying to create folders in Hierarchy panel
  • Expecting folders auto-created on import
  • Dragging assets into Scene to organize
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard