forked from LitJSON/litjson
-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
Description
By default Unity serializes public fields, as does LitJson. However the rules are a little more complicated. It should be possible to configure LitJson to directly mimic the serialization behaviour of Unity, most specifically to train it to respect the SerializeField attribute. (Note that this should be done without introducing a compile-time dependency between LitJson and UnityEngine, but rather by having a way to dynamically inject an attribute type or delegate to control what gets serialized.)
Unity will serialize the following types:
- any Unity object
- any custom class (but not struct) marked with System.Serializable attribute
- basic value types (string, float, int, etc.)
- Lists and arrays of serializable types
On these objects, the following will be serialized:
- public fields of serializable types
- private fields marked with the UnityEngine.SerializeField attribute
- -not- properties
More information on serialization from the Unity tech blog.