




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































Question 1. Which C# keyword is used to define a method that can be called without an instance of its class? A) static B) virtual C) abstract D) sealed Answer: A Explanation: A static method belongs to the class itself rather than any particular object, allowing it to be called directly via the class name. Question 2. In Unity, which attribute forces the editor to display a private field in the Inspector? A) [HideInInspector] B) [SerializeField] C) [RequireComponent] D) [ExecuteInEditMode] Answer: B Explanation: [SerializeField] tells Unity to serialize a private field, making it visible and editable in the Inspector. Question 3. Which of the following is true about C# events? A) They can be invoked from outside the declaring class.
B) They are multicast delegates that can have multiple listeners. C) They cannot be cleared with ‘= null’. D) They are the same as regular delegates. Answer: B Explanation: Events are built on delegates and support multiple subscribers, but only the declaring class can invoke them. Question 4. What is the execution order of these MonoBehaviour methods when a scene loads? A) Awake → Start → OnEnable B) OnEnable → Awake → Start C) Awake → OnEnable → Start D) Start → Awake → OnEnable Answer: C Explanation: Unity calls Awake first, then OnEnable, and finally Start during the initialization phase. Question 5. Which method should be used for physics‑based movement to ensure consistent behavior across different frame rates? A) Update() B) FixedUpdate() C) LateUpdate()
Explanation: The where clause allows you to constrain generic type parameters, for example to types that implement IDisposable. Question 8. In the new Input System, what does an Action Map represent? A) A single button press. B) A grouping of related input actions. C) The physical controller layout. D) A scriptable object storing key codes. Answer: B Explanation: An Action Map groups related Input Actions (e.g., “Player”, “UI”) enabling easy enable/disable of whole sets of controls. Question 9. Which Unity attribute guarantees that a required component is automatically added to a GameObject? A) [ExecuteAlways] B) [DisallowMultipleComponent] C) [RequireComponent] D) [AddComponentMenu] Answer: C Explanation: [RequireComponent] ensures that the specified component type is present on the GameObject, adding it if missing.
Question 10. Which collection provides O(1) average‑time lookup for unique keys? A) List
D) A static method that returns IEnumerator. Answer: B Explanation: Coroutines use IEnumerator to yield execution, allowing them to pause and resume on the main Unity thread without blocking. Question 15. When should you use Renderer.sharedMaterial instead of Renderer.material? A) When you need to modify the material for only one instance. B) When you want to change the material for all instances using that shared asset. C) When you are accessing a material in a coroutine. D) When you are writing a custom shader. Answer: B Explanation: sharedMaterial accesses the material asset shared among all renderers, so changes affect every object using that material. Question 16. Which of the following is a correct way to implement a thread‑safe Singleton in Unity? A) public static MyClass Instance { get; private set; } = new MyClass(); B) private static MyClass _instance; public static MyClass Instance => _instance ??= new MyClass(); C) public static MyClass Instance; void Awake(){ Instance = this; } D) Use a static constructor to create the instance.
Answer: B Explanation: The null‑coalescing assignment (??=) ensures the instance is created only once, and because Unity objects must be created on the main thread, this pattern is safe for most Unity use‑cases. Question 17. Which Unity method is guaranteed to be called after all Update() calls for the frame? A) FixedUpdate() B) LateUpdate() C) OnGUI() D) OnDisable() Answer: B Explanation: LateUpdate runs after all Update calls, making it suitable for camera follow logic that depends on objects’ final positions for the frame. Question 18. In the legacy Input system, which function returns true the first frame the key is pressed? A) Input.GetKey B) Input.GetKeyDown C) Input.GetKeyUp D) Input.GetButtonDown Answer: B
Question 21. Which Animator parameter type is most appropriate for triggering a one‑time animation transition? A) Float B) Bool C) Int D) Trigger Answer: D Explanation: Triggers are consumed automatically after causing a transition, perfect for single‑use events. Question 22. What does the OnAnimatorIK(int layerIndex) callback allow you to modify? A) Animation clip speeds. B) Bone positions and rotations using Inverse Kinematics. C) The playback time of the Animator. D) The list of active animation states. Answer: B Explanation: OnAnimatorIK is called after the Animator calculates its pose, letting you set IK targets for limbs.
Question 23. Which Unity attribute makes a component execute its Awake, OnEnable, etc., even when the game is not playing? A) [ExecuteInEditMode] B) [ExecuteAlways] C) [HideInInspector] D) [EditModeOnly] Answer: B Explanation: [ExecuteAlways] runs the script both in edit and play mode, whereas [ExecuteInEditMode] only runs in edit mode. Question 24. When using a Rigidbody set to “Is Kinematic”, which of the following is true? A) It is affected by physics forces automatically. B) It can be moved only by directly setting its Transform. C) It will generate collision callbacks when colliding with dynamic bodies. D) It cannot collide with any other collider. Answer: C Explanation: Kinematic Rigidbodies do not respond to forces but still generate collision/trigger events when other colliders intersect them. Question 25. Which method should you use to load a scene asynchronously while showing a loading screen?
C) action.canceled += MyMethod; D) action.Enable(); Answer: B Explanation: The performed event fires when the action’s binding conditions are met; you add a delegate (often a lambda) to it. Question 28. Which of the following best describes an extension method in C#? A) A static method that can be called as if it were an instance method on the extended type. B) A method that overrides a base class implementation. C) A delegate that extends the functionality of events. D) A coroutine that extends MonoBehaviour. Answer: A Explanation: Extension methods are static methods defined in static classes with the “this” modifier on the first parameter, allowing them to be invoked using instance syntax. Question 29. Which Unity UI component is responsible for automatically scaling UI elements based on screen size? A) CanvasScaler B) RectTransform
C) LayoutGroup D) ContentSizeFitter Answer: A Explanation: CanvasScaler adjusts the overall UI scaling mode (Constant Pixel Size, Scale With Screen Size, etc.) to keep UI readable on different resolutions. Question 30. When should you prefer Time.fixedDeltaTime over Time.deltaTime? A) In any Update loop. B) When performing physics calculations inside FixedUpdate. C) When animating UI elements. D) When measuring real‑world elapsed time. Answer: B Explanation: fixedDeltaTime represents the fixed timestep used by the physics engine, ensuring consistent physics behavior. Question 31. Which of the following Unity attributes prevents a component from being added more than once to the same GameObject? A) [DisallowMultipleComponent] B) [RequireComponent] C) [ExecuteInEditMode] D) [AddComponentMenu]
Question 34. Which physics query should you use to check whether a point lies inside any collider, ignoring triggers? A) Physics.OverlapSphere B) Physics.CheckSphere C) Physics.Raycast D) Physics.OverlapPoint (non‑existent) Answer: B Explanation: CheckSphere returns true if any non‑trigger collider overlaps the sphere defined by a point and radius. Question 35. In a MonoBehaviour, which method is called exactly once when the script instance is disabled? A) OnDisable B) OnDestroy C) OnApplicationQuit D) OnDisable is called multiple times. Answer: A Explanation: OnDisable runs each time the component is deactivated, whether by disabling the GameObject or the component itself.
Question 36. What is the effect of setting Animator.updateMode to AnimatorUpdateMode.UnscaledTime? A) The Animator will ignore the timeScale and run at real time. B) The Animator will pause when the game is paused. C) The Animator will update only during FixedUpdate. D) The Animator will update only when the object is visible. Answer: A Explanation: UnscaledTime makes the Animator use Time.unscaledDeltaTime, so animations continue even if Time.timeScale is set to 0. Question 37. Which of the following is a correct way to serialize a custom class to JSON in Unity? A) JsonUtility.FromJson
C) MeshRenderer D) Rigidbody Answer: B Explanation: CanvasRenderer is automatically added to UI elements and is necessary for them to be drawn by the UI system. Question 41. What does the Unity method DontDestroyOnLoad(target) accomplish? A) It prevents the target from being destroyed when a new scene loads. B) It disables the target’s collider. C) It unloads the target’s assets from memory. D) It makes the target invisible. Answer: A Explanation: DontDestroyOnLoad marks the object to persist across scene loads, keeping its state alive. Question 42. Which of the following is true about the FixedUpdate timestep setting (Time.fixedDeltaTime)? A) It can be changed at runtime to affect the physics step immediately. B) It is always equal to Time.deltaTime. C) It cannot be modified; it is constant. D) It only affects animation, not physics.
Answer: A Explanation: Changing fixedDeltaTime adjusts the duration of each physics step; the change takes effect on the next FixedUpdate. Question 43. In Unity’s new Input System, what does the “Interaction” field on an Input Action define? A) The device the action listens to. B) How the raw input is processed (e.g., Tap, Hold). C) The visual representation of the action. D) The default key binding. Answer: B Explanation: Interactions modify how an action interprets input, allowing you to require a tap, hold, or other patterns before the action fires. Question 44. Which method should you override to customize the behavior when a Unity UI Button is clicked via script? A) OnMouseDown() B) OnPointerClick(PointerEventData) C) OnClick() D) OnSubmit() Answer: B