Classes In Unity Flashcards
The Game Manager
Game Manager.cs is the class that controls the overall flow of the game. The Game Manager uses a design pattern called the Singleton
What is a Singleton
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.
A Singleton in Unity
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
What does the Game Manager do and contain
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
What is a Callback function in Unity
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.
What is Delegate and events in Unity
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
Which method in Game Object in Unity, calls a method on every MonoBehaviour in this game object or any of its children?
Broadcast Message
Select the value for game objects.SetActive() in Unity, which will make the game objects inactive?
False