Class fsBaseConverter
The serialization converter allows for customization of the serialization
process.
Inheritance
fsBaseConverter
Syntax
public abstract class fsBaseConverter
Fields
Serializer
The serializer that was owns this converter.
Declaration
public fsSerializer Serializer
Field Value
Methods
CheckKey(Dictionary<String, fsData>, String, out fsData)
Declaration
protected fsResult CheckKey(Dictionary<string, fsData> data, string key, out fsData subitem)
Parameters
Returns
CheckKey(fsData, String, out fsData)
Declaration
protected fsResult CheckKey(fsData data, string key, out fsData subitem)
Parameters
Returns
CheckType(fsData, fsDataType)
Declaration
protected fsResult CheckType(fsData data, fsDataType type)
Parameters
Returns
CreateInstance(fsData, Type)
Construct an object instance that will be passed to TryDeserialize.
This should not deserialize the object.
Declaration
public virtual object CreateInstance(fsData data, Type storageType)
Parameters
Type |
Name |
Description |
fsData |
data |
The data the object was serialized with.
|
Type |
storageType |
The field/property type that is storing the instance.
|
Returns
Type |
Description |
Object |
An object instance
|
DeserializeMember<T>(Dictionary<String, fsData>, Type, String, out T)
Declaration
protected fsResult DeserializeMember<T>(Dictionary<string, fsData> data, Type overrideConverterType, string name, out T value)
Parameters
Returns
Type Parameters
FailExpectedType(fsData, fsDataType[])
Declaration
protected fsResult FailExpectedType(fsData data, params fsDataType[] types)
Parameters
Returns
RequestCycleSupport(Type)
If true, then the serializer will support cyclic references with the
given converted type.
Declaration
public virtual bool RequestCycleSupport(Type storageType)
Parameters
Type |
Name |
Description |
Type |
storageType |
The field/property type that is currently storing the object that is
being serialized.
|
Returns
RequestInheritanceSupport(Type)
If true, then the serializer will include inheritance data for the
given converter.
Declaration
public virtual bool RequestInheritanceSupport(Type storageType)
Parameters
Type |
Name |
Description |
Type |
storageType |
The field/property type that is currently storing the object that is
being serialized.
|
Returns
SerializeMember<T>(Dictionary<String, fsData>, Type, String, T)
Declaration
protected fsResult SerializeMember<T>(Dictionary<string, fsData> data, Type overrideConverterType, string name, T value)
Parameters
Returns
Type Parameters
TryDeserialize(fsData, ref Object, Type)
Deserialize data into the object instance.
Declaration
public abstract fsResult TryDeserialize(fsData data, ref object instance, Type storageType)
Parameters
Type |
Name |
Description |
fsData |
data |
Serialization data to deserialize from.
|
Object |
instance |
The object instance to deserialize into.
|
Type |
storageType |
The field/property type that is storing the instance.
|
Returns
Type |
Description |
fsResult |
True if serialization was successful, false otherwise.
|
TrySerialize(Object, out fsData, Type)
Serialize the actual object into the given data storage.
Declaration
public abstract fsResult TrySerialize(object instance, out fsData serialized, Type storageType)
Parameters
Type |
Name |
Description |
Object |
instance |
The object instance to serialize. This will never be null.
|
fsData |
serialized |
The serialized state.
|
Type |
storageType |
The field/property type that is storing this instance.
|
Returns
Type |
Description |
fsResult |
If serialization was successful.
|
Extension Methods
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.