Problem
I have a private Array in my java script code. How can I make sure Unity3D serialize it?
private var myArray : Array = [];
This question has a clean, accepted answer. Please also see the related material for more details.
See also
- Array documentation.
- @SerializeField documentation.
- @Serializable documentation.
- @NonSerialized documentation.
Remarks
- Unity doesn't serialize a List of Lists, nor an Array of Arrays.
- Unity doesn't serialize Dictionary.
- Unity doesn't serialize static fields.
- Unity doesn't serialize properties.
- If an object occur more than once in a collection, that object is serialized for each occurance of it (creating clones).