WorksheetsLesson 04 Number Wizard UI
Total questions: 30
Worksheet time: 8hrs 30mins
When using Random.Range(min, max) where min is an integer of 1 and max is an integer of 5, what are are the possible values we can return?
1, 2, 3, 4
0, 1, 2, 3, 4
0, 1, 2, 3, 4, 5
1, 2, 3, 4, 5
When creating standalone PC/Mac builds it's always good manners to provide players with an easily accessible way to quit the game.
True
False
Using "Application.Quit() pretty much does nothing when used in the editor.
True
False
Application.Quit() always needs to be connected to a button and this is done using a public method.
True
False
The following function call will return random values in what range?int result = Random.Range(0, 7);
1, 2, 3, 4, 5, 6
0, 1, 2, 3, 4, 5, 6
1, 2, 3, 4, 5, 6, 7
1 or 7 only
When using Random.Range() with integers, min is inclusive and max is exclusive.
True
False
When displaying our guess to the player, why do we need to use ToString() and not just display our integer as it is?
To avoid the issue where our number has too many decimal places to display within our text box.
Because we are presenting both words and numbers in our guess box and need a way to combine those values.
We are using a text field so we can make our guess font look pretty, and our text field requires data as a string.
So that we can confuse the player, keep them guessing.
What would the following code output to the Console window?
The values 0, 1, 2 in that order
The values 0, 1, 2, 3 in that order
The values 1, 2, 3 in that order
The values 1, 2 in that order
What would the following code output to the Console window?
The values 4, 3, 2, 1, 0 in that order
The values 3, 2, 1, 0 in that order
The values 4, 3, 2, 1 in that order
The values 0, 1, 2, 3, 4 in that order
Why do we use [SerializeField] in front of our variables when declaring them?
To make our variables global so that they can be used by any script
Because it is often quicker / easier to make changes to our variables in the inspector than in our code.
To declare that our variables are private to a specific class.
Because it ensures that the variable is attached as a component to the relevant parent game object.
What is one advantage of marking a class member variable as "[Serializefield]" in a Unity project?
The variable will be hidden from all other classes
The variable can be modified only by your script's code
Initial values can be set directly from the Unity IDE
The variable can hold more than one value
What keyword do you add to a variable declaration so it will be visible outside the class and managed in the Unity Script component Inspector?
Serializefield
visible
global
private
Which of the following class variables can be freely read and modified by code outside the object?
private float cost;
[Seiarlizefield] int score;
protected string message;
visible bool gameOver;
Debug this code. We are trying to trigger OnPressHigher() from a button press, but it is not working. Why?
We have forgotten to add a semi-colon after our method declaration.
We always need to declare our min variable within the scope of the method - it is currently out of scope.
we have forgotten to add a return type to our method, it should not be void.
We have forgotten to add the public access modifier at the start of our method.
Which of the following statements will successfully load a scene indexed as "0"?
SceneManager.LoadScene (0);
Load("SecretRoom");
Scene.AddLevel("SecretRoom");
SceneManager.LoadScene ("0");
Let's debug some code. Why won't this code work as expected?
We have forgotten to add a semi-colon after LoadNextScene()
SceneManager should not have a capital 'S' given that it is referring to a class
We have forgotten to add a return type in our LoadNextScene() method - it should not be 'void'.
The name of the declared variable is different to the name of the variable we are passing in to our method.
Which of the following "using" statements should be placed at the top of a script that wants to change scenes?
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using Scenes;
using SceneManager;
What is the name of the dialog you use to enter a list of your scenes that are available in a standalone game, with the default scene placed at the top of the list?
Scene Manager
Project Manager
Build Settings
Scene Loader
How do you attach a script function to a Unity Button?
Double-click on the script in the Assets panel, then select the function name
Type in the name of the function next to the "Function" setting in the Inspector panel
Click the plus button under the On Click() setting, select a GameObject from the Hierarchy, and then select a function on a script attached to that object
Drag the script asset onto the Button object in the Hierarchy panel
What happens when a user clicks on a Unity button?
Unity will automatically call the OnClick() function on any script attached to the Button object
Unity will automatically call the OnClick() function on all scripts found within that scene
You can query for that button click state within an Update() function
Unity will call a function you have selected on an object you have selected under the On Click() panel
When we play the game and click on the "Lower" Button nothing happens. Why is that?
We have not provided the appropriate sprite image.
Navigation is set to automatic.
We have not assigned an On Click Function
The button needs a material to be set.
Which of the following best describes a flowchart?
A series of detailed comments in your code
A chart measuring the speed of program flow
A visual diagram of code decisions, actions and program flow
User documentation that describes how to work with your software
Which of the following flowchart shapes is used to connect other shapes together to show program flow?
Arrow
Dashed line
Wavy line
Thin rectangle
What GameObject is included when you create a new Unity Scene?
Main Sprite
Main Script
Main Background
Main Camera
When you create a Unity Button, it will become a child of which object in the Hierarchy?
Sprite
Camera
Canvas
Animator
What other object is automatically created with a new UI Button?
Text
AudioListener
Camera
Sprite
Which package can we use to make our font look nicer than the default font?
TicTac Pro
TeshMesh Pro
TexMex Pro
TextMesh Pro
What term is used to describe a change in an image width and height, in pixels, while still showing the entire image area?
Resizing
Cropping
Converting
Rasterizing
What process is used to remove the unwanted parts of an image in order to display only a smaller area?
Resizing
Cropping
Converting
Rasterizing
Which of the following image formats support transparency, which is often important for game sprites?
JPG
BMP
TIFF
PNG and GIF
