Serialize and Scriptable Objects

Hello Guys,

I’m studying C# for Unity, but I cant to understand what happens when I put before the class the attribute [Serializable]. And I also cant to understand how to make persistent data, with the Scriptable Hiretance. Can Anyone explain me a little about these concepts and application?

Thanks!!

I would start with this tutorial. It covers data persistence, serialization, and most of the basics you are asking for.

http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/persistence-data-saving-loading

1 Like

When you serialize a custom class, you’re allowing it to be seen in the inspector. Same goes with Structs.

You should be using [System. Serializable] for class/structs.

for variables that are private, you can serialize those fields and see them in the inspector as well by using : [SerializeField]