Classes In Unity Flashcards

1
Q

The Game Manager

A
Game Manager.cs is the class that controls the overall flow of the game.
The Game Manager uses a design pattern called the Singleton
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a Singleton

A
The Singleton pattern is a way of ensuring that there is only ever one instance of a particular class in the game. 
Contains static variables that can accommodate unique and private instances of itself
A programming pattern that allows you to access a class script without using a GetComponent reference.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A Singleton in Unity

A

A globally accessible class that exists in the scene, but only once. The idea that any other script can access the Singleton, allowing you to easily connect objects to important parts of the game, such as to the player or to other game systems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the Game Manager do and contain

A

The Game Manager keeps track of what state the game is in, manages the menu/pause systems, records and stores information for various purposes (audio/video, settings, control bindings, game save data, etc) that it needs to exist over multiple levels

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a Callback function in Unity

A

A Callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of action.
Delegate provides a way to pass a method as argument to other methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Delegate and events in Unity

A

Events in Unity are a special kind of multicast Delegate and, generally speaking, they work in the same way as regular delegates.
However, while delegates can be called by other scripts,
Event delegates can only be triggered from within their own class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which method in Game Object in Unity, calls a method on every MonoBehaviour in this game object or any of its children?

A

Broadcast Message

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Select the value for game objects.SetActive() in Unity, which will make the game objects inactive?

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly