0
0
Unityframework~5 mins

Variables and serialization in Unity - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a variable in Unity?
A variable is a container that holds data, like numbers or text, which can change while the program runs.
Click to reveal answer
beginner
What does serialization mean in Unity?
Serialization is the process of saving an object's data so Unity can store or transfer it, like saving game settings or player progress.
Click to reveal answer
intermediate
Why use the [SerializeField] attribute in Unity?
It lets private variables show up in the Unity Editor so you can change their values without making them public.
Click to reveal answer
intermediate
What types of variables can Unity serialize by default?
Unity can serialize basic types like int, float, string, bool, and also Unity types like Vector3 and custom classes marked with [System.Serializable].
Click to reveal answer
beginner
How does serialization help with saving game data?
Serialization converts game data into a format that can be saved to a file or sent over a network, so the game can load it later exactly as it was.
Click to reveal answer
Which keyword makes a variable visible in the Unity Editor without making it public?
Aprivate
Bpublic
C[SerializeField]
Dstatic
What is the main purpose of serialization in Unity?
ATo change variable types
BTo speed up the game
CTo create variables
DTo save and load data
Which of these variable types can Unity serialize by default?
Aint, float, string
Bdelegate, event
CThread, Task
DPointer, Reference
What happens if you make a variable public in Unity?
AIt becomes visible and editable in the Unity Editor
BIt becomes hidden in the Editor
CIt cannot be serialized
DIt runs faster
Which attribute marks a custom class as serializable in Unity?
A[SerializeField]
B[System.Serializable]
C[HideInInspector]
D[NonSerialized]
Explain what variables and serialization mean in Unity and why they are important.
Think about how data is stored and changed in a game.
You got /3 concepts.
    Describe how you would make a private variable editable in the Unity Editor using serialization.
    It's about showing private data without making it public.
    You got /3 concepts.