Version 3.3.1.2

Sirenix.Serialization namespace

Classes

Applying this attribute to a type indicates that in the case where, when expecting to deserialize an instance of the type or any of its derived types, but encountering an incompatible, uncastable type in the data being read, the serializer should attempt to deserialize an instance of the expected type using the stored, possibly invalid data.

This is equivalent to the AllowDeserializeInvalidData option, expect type-specific instead of global.

Use this attribute to specify that a type that implements the Sirenix.Serialization.ISelfFormatter interface should *always* format itself regardless of other formatters being specified.

This means that the interface will be used to format all types derived from the type that is decorated with this attribute, regardless of custom formatters for the derived types.

Custom formatter for the UnityEngine.AnimationCurve type.
Contains configuration for generating an assembly that provides increased AOT support in Odin.
This class gathers info about the current architecture for the purpose of determinining the unaligned read/write capabilities that we have to work with.
Formatter for all non-primitive one-dimensional arrays.
Custom formatter for the type System.Collections.ArrayList.
Provides basic functionality and overridable abstract methods for implementing a data reader.

If you inherit this class, it is VERY IMPORTANT that you implement each abstract method to the *exact* specifications the documentation specifies.

Implements functionality that is shared by both data readers and data writers.
Provides basic functionality and overridable abstract methods for implementing a data writer.

If you inherit this class, it is VERY IMPORTANT that you implement each abstract method to the *exact* specifications the documentation specifies.

Not yet documented.
Provides common functionality for serializing and deserializing values of type , and provides automatic support for the following common serialization conventions:

System.Runtime.Serialization.IObjectReference, , System.Runtime.Serialization.OnSerializingAttribute, System.Runtime.Serialization.OnSerializedAttribute, System.Runtime.Serialization.OnDeserializingAttribute and System.Runtime.Serialization.OnDeserializedAttribute.

Reads data from a stream that has been written by a BinaryDataWriter.
Writes data to a stream that can be read by a BinaryDataReader.
An attribute that lets you help the DefaultSerializationBinder bind type names to types. This is useful if you're renaming a type, that would result in data loss, and what to specify the new type name to avoid loss of data.
Serializer for the System.Boolean type.
Custom formatter for the UnityEngine.Bounds type.
Provides a way of claiming and releasing cached array buffers.
Serializer for the System.Byte type.
Serializer for the System.Char type.
Custom formatter for the UnityEngine.Color32 type.
Custom formatter for the type.
Custom formatter for the UnityEngine.Color type.
Serializer for all complex types; IE, types which are not primitives as determined by the IsPrimitiveType(Type) method.

Custom formatter for the UnityEngine.Coroutine type. This serializes nothing and always deserializes null, and only exists to ensure that no coroutine instances are ever created by the serialization system, since they will in almost all cases be invalid instances.

Invalid coroutine instances crash Unity instantly when they are garbage collected.

A helper class for quickly and easily defining custom loggers.
Helper class for quickly and easily implementing the Sirenix.Serialization.ISerializationPolicy interface.
Custom formatter for the System.DateTime type.
Custom formatter for the System.DateTimeOffset type.
Defines a context for debugging and logging during serialization and deserialization. This class is thread-safe.
Serializer for the System.Decimal type.
Defines default loggers for serialization and deserialization. This class and all of its loggers are thread safe.
Provides a default, catch-all TwoWaySerializationBinder implementation. This binder only includes assembly names, without versions and tokens, in order to increase compatibility.
Formatter for all delegate types.

This formatter can handle anything but delegates for dynamic methods.

The context of a given deserialization session. This class maintains all internal and external references during deserialization.
Custom generic formatter for the generic type definition System.Collections.Generic.Dictionary<TKey, TValue>.
Provides utility methods for handling dictionary keys in the prefab modification system.
A smart comparer for dictionary keys, that uses the most appropriate available comparison method for the given key types.
Serializer for the System.Double type.
Provides an easy way of implementing custom formatters.
Indicates that this formatter type has been emitted. Never put this on a type!
A formatter for empty types. It writes no data, and skips all data that is to be read, deserializing a "default" value.
Serializer for all enums.
Utility class for emitting formatters using the System.Reflection.Emit namespace.

NOTE: Some platforms do not support emitting. Check whether you can emit on the current platform using Sirenix.Serialization.Utilities.EmitUtilities.CanEmit.

Base type for all AOT-emitted formatters.
Shortcut class that makes it easier to emit empty AOT formatters.
Utility class for locating and caching formatters for all non-primitive types.
Provides an array of utility methods which are commonly used by serialization formatters.
Formatter for all eligible types that implement the interface System.Collections.Generic.ICollection<T>, and which have no other formatters specified.

Eligibility for formatting by this class is determined by the CanFormat(Type, out Type) method.

Not yet documented.
Custom formatter for the UnityEngine.GradientAlphaKey type.
Custom formatter for the UnityEngine.GradientColorKey type.
Custom formatter for the UnityEngine.Gradient type.
Serializer for the System.Guid type.
Custom generic formatter for the generic type definition System.Collections.Generic.HashSet<>.
Serializer for the System.Int16 type.
Serializer for the System.Int32 type.
Serializer for the System.Int64 type.
Serializer for the System.IntPtr type.
Contains various string constants used by the JsonDataWriter, JsonDataReader and JsonTextReader classes.
Reads json data from a stream that has been written by a JsonDataWriter.
Writes json data to a stream that can be read by a JsonDataReader.
Parses json entries from a stream.
Custom formatter for the UnityEngine.Keyframe type.
Custom generic formatter for the generic type definition System.Collections.Generic.KeyValuePair<TKey, TValue>.
Custom formatter for the UnityEngine.LayerMask type.
Custom generic formatter for the generic type definition System.Collections.Generic.List<T>.
Custom formatter for MethodInfo, since Unity Mono's MethodInfo ISerializable implementation will often crash if the method no longer exists upon deserialization.
Minimal baseline formatter. Doesn't come with all the bells and whistles of any of the other BaseFormatter classes. Common serialization conventions aren't automatically supported, and common deserialization callbacks are not automatically invoked.
Formatter for all arrays with more than one dimension.
Formatter for all System.Nullable<T> types.
Indicates that an instance field or auto-property should be serialized by Odin.
An Odin-serialized prefab modification, containing all the information necessary to apply the modification.
Indicates that an instance field or auto-property was previously serialized with a different name, so that values serialized with the old name will be properly deserialized into this member. This does the same as Unity's FormerlySerializedAs attribute, except it can also be applied to properties.
Formatter for all primitive one-dimensional arrays.
Corresponds to the .NET System.BitConverter class, but works only with buffers and so never allocates garbage.

This class always writes and reads bytes in a little endian format, regardless of system architecture.

Custom formatter for the UnityEngine.Quaternion type.
Custom generic formatter for the generic type definition System.Collections.Generic.Queue`1.
Custom formatter for the UnityEngine.Rect type.
Final fallback formatter for all types which have no other formatters. This formatter relies on reflection to work, and is thus comparatively slow and creates more garbage than a custom formatter.
Serializer for the System.SByte type.
Formatter for types that implement the Sirenix.Serialization.ISelfFormatter interface.
Formatter for all types that implement the ISerializable interface.
An exception thrown when the serialization system has encountered an issue so severe that serialization is being aborted. If this exception is caught in the serialization system somewhere, it should be rethrown.
Defines the configuration during serialization and deserialization. This class is thread-safe.
The context of a given serialization session. This class maintains all internal and external references during serialization.
Not yet documented.
Not yet documented.
Contains a set of default implementations of the Sirenix.Serialization.ISerializationPolicy interface.

NOTE: Policies are not necessarily compatible with each other in intuitive ways. Data serialized with the Everything policy will for example fail to deserialize auto-properties with Strict, even if only strict data is needed. It is best to ensure that you always use the same policy for serialization and deserialization.

This class and all of its policies are thread-safe.

Provides an array of utility wrapper methods for easy serialization and deserialization of objects of any type.
Serializes and deserializes a given type, and wraps serialization and deserialization with all the proper calls to free formatters from tedious boilerplate.

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.

Serializes and deserializes the type , and wraps serialization and deserialization with all the proper calls to free formatters from tedious boilerplate.

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.

Serializer for the System.Single type.
Custom generic formatter for the generic type definition System.Collections.Generic.Stack<> and types derived from it.
Serializer for the System.String type.
Custom formatter for the System.TimeSpan type.
Binds types to strings during serialization, and strings to types during deserialization.
Formatter for the System.Type type which uses the reader/writer's TwoWaySerializationBinder to bind types.
Serializer for the System.UInt16 type.
Serializer for the System.UInt32 type.
Serializer for the System.UInt64 type.
Serializer for the System.UIntPtr type.
Custom generic formatter for the UnityEngine.Events.UnityEvent`1, UnityEngine.Events.UnityEvent`2, UnityEngine.Events.UnityEvent`3 and UnityEngine.Events.UnityEvent`4 types.
Resolves external index references to Unity objects.
Utility class which initializes the Sirenix serialization system to be compatible with Unity.
Provides an array of utility wrapper methods for easy serialization and deserialization of Unity objects of any type. Note that, during serialization, it is always assumed that we are running on Unity's main thread. Deserialization can happen on any thread, and all API's interacting with deserialization are thread-safe.

Note that setting the IndexReferenceResolver on contexts passed into methods on this class will have no effect, as it will always be set to a UnityReferenceResolver.

Not yet documented.
Custom formatter for the UnityEngine.Vector2 type.
Custom formatter for the UnityEngine.Vector2Int type.
Dictionary key path provider for UnityEngine.Vector3
Custom formatter for the UnityEngine.Vector3 type.
Custom formatter for the UnityEngine.Vector3Int type.
Custom formatter for the UnityEngine.Vector4 type.
Custom formatter for the System.Version type.
Provides common functionality for serializing and deserializing weakly typed values of a given type, and provides automatic support for the following common serialization conventions:

System.Runtime.Serialization.IObjectReference, , System.Runtime.Serialization.OnSerializingAttribute, System.Runtime.Serialization.OnSerializedAttribute, System.Runtime.Serialization.OnDeserializingAttribute and System.Runtime.Serialization.OnDeserializedAttribute.

Structs

Contains information about a node during deserialization and serialization.
Unity serialized data struct that contains all data needed by Odin serialization.
A serialization node as used by the Nodes format.

Enums

Entry types in the binary format written by BinaryDataWriter.
Specifies a data format to read and write in.
An entry type which is part of a stream being read by a Sirenix.Serialization.IDataReader.
The policy for handling errors during serialization and deserialization.
The policy for which level of logging to do during serialization and deserialization.
Types of prefab modification that can be applied.