Class UnityObjectSerializer
Custom converter to allow less verbose Newtonsoft serialization of Unity builtin objects. This converter manually handles several cases, add more as they become necessary.
Namespace: IVLab.ABREngine
Assembly: IVLab.ABREngine.Runtime.dll
Syntax
public class UnityObjectSerializer : JsonConverter
Constructors
| Improve this Doc View SourceUnityObjectSerializer()
Build the custom converter and define both the types that are allowed to be serialized and the string keys that are allowed to exist post-serialization
Declaration
public UnityObjectSerializer()
Properties
| Improve this Doc View SourceCanRead
Gets a value indicating whether this Newtonsoft.Json.JsonConverter can read JSON.
Declaration
public override bool CanRead { get; }
Property Value
Type | Description |
---|---|
bool |
|
Overrides
Methods
| Improve this Doc View SourceCanConvert(Type)
We only provide serializers for these types
Declaration
public override bool CanConvert(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type |
Returns
Type | Description |
---|---|
bool |
Overrides
| Improve this Doc View SourceReadJson(JsonReader, Type, object, JsonSerializer)
Reads the JSON representation of the object.
Declaration
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
JsonReader | reader | The Newtonsoft.Json.JsonReader to read from. |
Type | objectType | Type of the object. |
object | existingValue | The existing value of object being read. |
JsonSerializer | serializer | The calling serializer. |
Returns
Type | Description |
---|---|
object | The object value. |
Overrides
| Improve this Doc View SourceWriteJson(JsonWriter, object, JsonSerializer)
Writes the JSON representation of the object.
Declaration
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
JsonWriter | writer | The Newtonsoft.Json.JsonWriter to write to. |
object | value | The value. |
JsonSerializer | serializer | The calling serializer. |