Completion Complete each
statement.
|
|
1.
|
________________ is an attribute that allows protected access to derived
classes.
|
|
2.
|
What is the Build type for projects to be uploaded and embedded online?
|
|
3.
|
______________ is creating a reusable pool of objects that can be activated and
deactivated rather than instantiated and destroyed, which is much more efficient.
|
|
4.
|
_______________________ are Unity’s default methods that run in a very
particular order over the life of a script.
|
|
5.
|
What is the operator used in C# to output the remainder or Modulus?
|
Multiple Choice Identify the
choice that best completes the statement or answers the question.
|
|
6.
|
You run your game and get the following error message in the console,
“NullReferenceException: Object reference not set to an instance of an object”. Given the
image and code below, what would resolve the problem?
a. | In the hierarchy, rename “Game Manager” to
“gameManager” | c. | In the hierarchy, rename “Game Manager” as
“GameManager” | b. | On Line 3, remove the GetComponent
code | d. | On Line 1, rename
“GameManager” as “Game Manager” |
|
|
7.
|
Which code to fill in the blank will result in the object being
destroyed?
a. | name = “player” && isDead && health < 5 | c. | name ==
“player” && isDead != true && health > 5 | b. | name !=
“player” && isDead != true && health > 5 | d. | name == “player” &&
!isDead && health < 5 |
|
|
8.
|
Look at the documentation and code below. Which of the following lines would NOT
produce an error?
a. | Line 6 | c. | Line 5 | b. | Line 7 | d. | Line 8 |
|
|
9.
|
Which of the following follows Unity naming conventions (especially as they
relate to capitalization)?
a. | Line 1 | c. | Line 3 | b. | Line 4 | d. | Line 2 |
|
|
10.
|
Which of the following is the correct way to declare a new List of game objects
named “enemies”?
a. | Line 3 | c. | Line 1 | b. | Line 2 | d. | Line 4 |
|
|
11.
|
Based on the code below, what will be displayed in the console when the button
is clicked?
a. | “Welcome, firstName Smith” | c. | “Welcome + Robert +
Smith” | b. | “Button is ready” | d. | “Welcome, Robert
Smith” |
|
|
12.
|
Read the Unity documentation below about the OnMouseDrag event and the code
beneath it. What will the value of the “counter” variable be if the user clicked and held
down the mouse over an object with a collider for 10 seconds?
a. | 1 | d. | 100 | b. | A value over 100 | e. | 0 | c. | 99 |
|
|
13.
|
If there is a boolean in script A that you want to access in script B, which of
the following are true:
a. | 3 and 4 only | d. | 1, 2, and 3 only | b. | 2 and 3 only | e. | 1 and 2 only | c. | All are
true | f. | 1
only |
|
|
14.
|
You have declared a new Button variable as “private Button start;”,
but there’s an error under the word “Button” that says “error CS0246: The
type or namespace name 'Button' could not be found (are you missing a using directive or an
assembly reference?)”
a. | New Button variables must be made public | c. | “Button” should be
lowercase “button” | b. | You are missing “using
UnityEngine.UI;” from the top of your class | d. | You can’t name a button
“start” because that’s the name of a Unity Event
Function |
|
|
15.
|
If you wanted a button to display the message, “Hello!” when a
button was clicked, what code would you use to fill in the blank?
a. | (SendMessage); | c. | (SendMessage(Hello)); | b. | (SendMessage(“Hello”)); | d. | (SendMessage(string
Hello)); |
|