Namespace: | Sirenix.Serialization |
Assembly: | Sirenix.Serialization |
public abstract class Serializer
Whenever serializing or deserializing anything, it is *strongly recommended* to use Get<T>() to get a proper wrapping serializer for that type.
NOTE: This class should NOT be inherited from; it is hard-coded into the system.
To extend the serialization system, instead create custom formatters, which are used by the ComplexTypeSerializer<T> class.
protected Serializer()
[Conditional("UNITY_EDITOR")]
protected static void FireOnSerializedType(Type type)
System.Type | type |
public static Serializer Get(Type type)
System.Type | type | The type to get a Serializer for. |
Serializer | A Serializer for the given type. |
System.ArgumentNullException | The type argument is null. |
public static Serializer<T> Get<T>()
Serializer<T> | A Serializer for type T. |
T | The type to get a Serializer for. |
public static Serializer GetForValue(object value)
System.Object | value | The value to get a Serializer for. |
Serializer | A Serializer for the given value. |
public abstract object ReadValueWeak(IDataReader reader)
Sirenix.Serialization.IDataReader | reader | The reader to use. |
System.Object | The value which has been read. |
public void WriteValueWeak(object value, IDataWriter writer)
System.Object | value | The value to write. |
Sirenix.Serialization.IDataWriter | writer | The writer to use. |
public abstract void WriteValueWeak(string name, object value, IDataWriter writer)
System.String | name | The name of the value to write. |
System.Object | value | The value to write. |
Sirenix.Serialization.IDataWriter | writer | The writer to use. |
public static event Action<Type> OnSerializedType