Unity gMetrix Module 11
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Medium
Raymundo Martinez
Used 1+ times
FREE Resource
Enhance your content in a minute
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code: public class Employee : MonoBehaviour{ public int employeeId = 10; public int employeeAge = 35; public int GetEmployeeId(){ return 10; } } If you want to access the employeeId value from another script on the same GameObject, which is the proper way to do it?
GetComponent<Employee>(.employeeld = 5;
GetComponent<MonoBehaviour>().Employeeld = 5;
gameObject.Employee.Employeeld = 5;
Employee.employeeId = 5;
Answer explanation
GetComponent is how you can get a reference of a Component. If the Component is on the same GameObject, you don't need a reference to another GameObject. You
would use GetComponent<Employee>().employeeld = 5; to get the employeeld value.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a custom word that can be assigned to a GameObject to create a custom identifier?
Mark
Id
Label
Tag
Answer explanation
Tags are word-based custom identifiers you can add to a GameObject.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When the game starts playing in the editor, the following message is shown in the Console window: "Hello World!". Which of the following lines of code will generate that message if added to the Start method?
Debug.Log("Hello World" + !);
Debug.Log("Hello World" + "!");
Debug.Log(Hello World!)
Debug.Log("HelloWorld" + "!");
Answer explanation
Debug.Log("Hello World" + "!"); is the only line of code that will generate that message.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following components receives input for any given AudioSource in a scene?
Audio Listener
Audio Mixer
Audio Manager
Audio Clip
Answer explanation
Audio Listeners are capable of receiving input from Audio Sources and playing the sound through speakers.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Considering the following image and code, the press of the button will cause currentHealth to increase by one.
Button addHealth;
int currentHealth;
private void Start()
{
addHealth.onClick.AddListener(IncreaseHealth);
}
void IncreaseHealth() {
currentHealth++;
}
True
False
Answer explanation
Button events can be added on the Inspector and also through code.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Unit 2 Relational Databases Quiz
Quiz
•
12th Grade
10 questions
Computer Applications
Quiz
•
12th Grade
10 questions
Mastering Microsoft 365 Applications
Quiz
•
12th Grade - University
10 questions
Evaluación Diagnóstica Comunicación Digital
Quiz
•
12th Grade
10 questions
T9 - B12: THÔNG TIN ĐA PHƯƠNG TIỆN
Quiz
•
9th - 12th Grade
10 questions
Control Structures
Quiz
•
12th Grade
10 questions
Fundamentals of Computing - Unit 5 Quiz 1 Review
Quiz
•
12th Grade
10 questions
Struktur Database
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
