What is the function of the On-Click-Method in Unity?
Linking to a game object/scene to a button.
What happens when you set Time.timeScale to 0 in Unity?
Setting Time.timeScale to 0 pauses the game by stopping all time
What is the purpose of PlayerPrefs in Unity?
PlayerPrefs is a simple way to store and retrieve small amounts of persistent data between game scene to scene.
What is a sprite sheet, and how is it different from a single sprite?
A sprite sheet is a single image file containing multiple sprites or frames arranged in a grid or sequence. And the difference is that a single sprite is a single image, while a sprite sheet combines multiple sprites, usually for animation.
What is the probability of rolling a 6 on a standard six-sided die?
1/6
In Unity, How would you add a new scene to the build settings in your game?
Open the file in the Unity Editor, click the build setting, and move each scene(in the order that you want) in the build settings. When finished, click build.
What is the purpose of FindObjectsWithTag()?
In Unity, the role of FindObjectWithTag() is to locate and retrieve all active game objects in the scene that share a specific tag.
How do you ensure only the top 5 high scores are stored using PlayerPrefs?
Insert new Score into the list.
Descending to sort the list.
Keep at most the top 5 Score.
Use the PlayerPrefs that saved those Score.
In unity, what is an animator?
a part of a game object that lets you use a state machine to control its animations
There are 4 red balls, 5 green balls, and 6 blue balls in a bag. What is the probability of drawing a red ball?
4/15
What is a UI Text Box? What is a UI Button? What is the difference between these two UI elements in Unity?
UI Text Box is used to display text on the screen. UI Button is a button that can be used to link other game objects/scenes. The difference between these two is that the UI Text Box displays/stores text while the UI Button is interactive.
What is the purpose of the OnClick() method in Unity UI Buttons?
The OnClick() method in a Unity UI button is used to define a specific action or function to be performed when the player clicks the button.
What is the purpose of the Awake() method in Unity?
It is called before any other methods in the script for initialization.
What is the sprite editor?
By dividing a sprite sheet into separate frames that may be used in animations, this Unity feature makes it simpler to generate fluid, frame-by-frame motion for your objects or characters.
The player has a 30% chance of finding a rare weapon in every treasure chest they open. What is the probability of finding a rare weapon in exactly one of two treasure chests they open?
70%
Below is a method of a script,
private void AdvanceLevel()
{
if (level < 10)
{
SceneManager.LoadScene(level + 1);
}
else
{
SceneManager.LoadScene(11);
}
}
In English, what does the code above do?
It checks the build index if it is less than 10 then it will load the next scene. If the build index is greater than 10, it will load scene 11.
How do you write a program when player find the enemy the enemy will be delete?
void OnCollisionEnter2D(Collision2D collision) { if(collision.gameObject.CompareTag("Enemy")) { Destroy(collision.gameObject); } }
PlayerPrefs is frequently utilized in Unity for this function. Why is it commonly utilized, and what are the techniques for setting and retrieving data?
PlayerPrefs.Set<Type> to store data PlayerPrefs.Get<Type> to retrieve it
utilizing it since it offers a straightforward method of preserving basic data, like user preferences or game progress.
Which component is used to manage transitions between various animations, such walking and jumping, while animating a character in Unity using a sprite sheet?
Animator Controller?
Describe what are accessibilities in game design?
This phrase describes features like adjustable controls, colorblind modes, or subtitles that are intended to make games accessible to individuals with impairments.
What is the default behavior when a UI Button is clicked, if you do not assign an OnClick method?
Nothing happens.
What is GameObject.setActive?
This method changes the visibility and functionality of a GameObject in Unity without destroying it.
Why would a class use a static instance to control global behavior or state? Give an example of how it could be used in a gaming environment, highlighting the function of Unity's Awake() method.
A static instance is helpful in situations like player settings, game managers, and audio managers because it enables a class to control a single, globally accessible instance.
Code:
private void Awake()
{
if (instance == null)
{
DontDestroyOnLoad(this);
instance = this;
}
else
{
Destroy(gameObject);
}
}
The timing and transitions of sprite-based animations made from sprite sheets are managed by this Unity animation tool using keyframes.
Animation Window
Describe inclusive design.
By include features like remappable controllers, colorblind modes, and screen readers, this game design philosophy aims to make sure that players with physical, sensory, or cognitive limitations may still enjoy the game.