I have a little question, if someone can help me, I'll be grateful.
What is Serializable field in Unity ?
How it works for an object of a class ?
In code it's looks like :
[Serializable]
or
[System.Serializable]
I have a little question, if someone can help me, I'll be grateful.
What is Serializable field in Unity ?
How it works for an object of a class ?
In code it's looks like :
[Serializable]
or
[System.Serializable]
[Serializable] private GameObject gameobject;
[System.Serializable] private int timer;
The serializable field works like a public variable except that you can using it for a private variable. Some people just use a public variable but a serializable private variable works the same.
Might be a lazy answer... but Unity provides a very useful documentation (with examples) which explains every command, even [Serializable].
Here is the link to what you are looking for: