MethodInfoFormatter<T> class

Namespace: Sirenix.Serialization
Assembly: Sirenix.Serialization
public sealed class MethodInfoFormatter<T> : BaseFormatter<T>, IFormatter<T>, IFormatter where T : MethodInfo
Custom formatter for MethodInfo, since Unity Mono's MethodInfo ISerializable implementation will often crash if the method no longer exists upon deserialization.
See Also

Type Parameters



public MethodInfoFormatter()


DeserializeImplementation(ref T, IDataReader)
Provides the actual implementation for deserializing a value of type .
protected override void DeserializeImplementation(ref T value, IDataReader reader)
T value

The uninitialized value to serialize into. This value will have been created earlier using OdinSerializer.BaseFormatter`1.GetUninitializedObject.

Sirenix.Serialization.IDataReader reader

The reader to deserialize with.

Get an uninitialized object of type . WARNING: If you override this and return null, the object's ID will not be automatically registered and its OnDeserializing callbacks will not be automatically called, before deserialization begins. You will have to call OdinSerializer.BaseFormatter`1.RegisterReferenceID(`0,OdinSerializer.IDataReader) and OdinSerializer.BaseFormatter`1.InvokeOnDeserializingCallbacks(`0,OdinSerializer.DeserializationContext) immediately after creating the object yourself during deserialization.
protected override T GetUninitializedObject()

An uninitialized object of type .

SerializeImplementation(ref T, IDataWriter)
Provides the actual implementation for serializing a value of type .
protected override void SerializeImplementation(ref T value, IDataWriter writer)
T value

The value to serialize.

Sirenix.Serialization.IDataWriter writer

The writer to serialize with.

This website is brand new and built with the Odin 2.1 beta in mind. This means you might discover some features such as attribute expressions that are only available in the beta.

You can download the 2.1 beta from here and read the patch-notes here.