Overview - Variables and serialization
What is it?
Variables in Unity are containers that store data like numbers, text, or objects. Serialization is the process of converting these variables into a format that Unity can save and load, such as when saving a game or showing values in the Inspector. This lets Unity remember the state of your game objects between sessions or during editing. Without serialization, Unity wouldn't be able to keep track of changes made in the editor or save game progress.
Why it matters
Serialization allows Unity to save and load game data, making games feel continuous and interactive. It also lets developers tweak variables in the editor and see changes immediately, speeding up development. Without serialization, every time you stopped playing or closed the editor, all your changes and progress would be lost, making game development and play impossible to manage.
Where it fits
Before learning this, you should understand basic programming concepts like variables and data types. After this, you can explore Unity's scripting lifecycle, custom editors, and saving/loading game states. Serialization connects basic coding with how Unity manages data behind the scenes.