Unity: Textboxes and Scenes
Unity: Buttons and Time
Persistent Data and High Scores
Probability
100

This is the element to have text input.

What is Input Field?

100

This Unity feature allows control over the speed of time in the game.

What is Time.timeScale?

100

What is the design pattern used in class to implement persistent data?

What is Singleton

100

A die is rolled and a coin is tossed. Find the probability that the die shows an odd number and the coin shows a head.

The probability of both together is ¼

200

This is how you load a scene.

What is SceneManager.LoadScene()?

200

In Unity, which method is used to find all GameObjects with a specific tag?

What is FindObjectsWithTag?

200

This method in Unity is automatically called when a script is loaded, even before Start(). What is the name of this method?

What is Awake()

200

Assume that you pick two cards from a deck of cards (without replacing the first card before you pick the second). What is the probability that both are number cards

Thus the probability of them both being numbers are 9/13 * 35/51 = 315/663.

300

This is how you add text to a button.

What is modifying the child text element?

300

Which function in Unity is used to detect button clicks and execute corresponding actions?

What is OnClick

300

How do you set a value using PlayerPrefs in Unity, and what is the method to retrieve that value?

What is PlayerPrefs.SetInt("key", value) PlayerPrefs.SetFloat("key", value) PlayerPrefs.GetInt("key")  PlayerPrefs.GetFloat("key")

300

Suppose you have just been given a certain tetronimo. What is the probability that the next piece will have the same shape, using the Random A strategy?

Random A: At every iteration, select a tetronimo at random from all seven possibilities  

Each piece is drawn randomly, so the chance of you getting the same shape is 1/7

400

This method lets you detect which scene is currently loaded.

What is SceneManager.GetActiveScene()?

400

In Unity, which method is utilized to activate or deactivate a GameObject?

What is [GameObject].SetActive

400

This is how you declare arrays in Unity.

What is dragging and dropping elements in array data fields in the script component?

400

(I'll use this shorthand a lot, so just FYI: "2d6" means rolling two six-sided dice at once. So "4d10" means four ten-sided dice, and so on)

Rolling 2d6, what is the probability of rolling at least one 6?

The answer is: 6/36 + 6/36 - 1/36 = 11/36

500

This is where you add scenes for the game to access them at runtime.

What are Build Settings?

500

Set this to 0 to pause the game or 1 to resume

Time.timeScale?

500

A basic algorithm for storing top X high scores (Just a short overview of the algo)

What is using arrays to store high scores, and updated based on player score

500

(I'll use this shorthand a lot, so just FYI: "2d6" means rolling two six-sided dice at once. So "4d10" means four ten-sided dice, and so on) 

Rolling 2d6, what is the probability of getting both 5s

The probability of a 5 on the first die is ⅙; the probability of a 5 on the second die is ⅙; the probability of both is an AND = 1/36