- Home /
Why doesn't Unity support serializing composite types in the inspector? and how to work around it?
Unity build in types , primitives , and custom classes seems to be the only types that can serialized through the inspector, why is this? why don't the inspector support nested lists, static fields, tuples ect.? To me it seems to be an essential feature that is not supported? So I guess there must be something wrong with the way I use the inspector, and how much I rely on it? Have anyone had a similar mindset before and changed it?
Answer by Monsoonexe · May 21, 2021 at 06:00 PM
You can use an attribute [System.Serializable]
to make your classes and structs such. Some things cannot be serialized easily, like generics and 2d arrays, and will require a custom Inspector to draw.
Your answer
Follow this Question
Related Questions
Unable to draw propertyfield in inspector for some classes, findProperty returns null. 0 Answers
How i can subscribe to an Event through Inspector 0 Answers
How do I make child classes in a list editable from the Inspector? 1 Answer
Error when trying to Serialize a field that is in a class 0 Answers
Serializing list of base and derived classes with custom inspector 1 Answer