Class SerializationManager
Helper class to manage the MLAPI serialization.
Inherited Members
Namespace: MLAPI.Serialization
Assembly: Unity.Multiplayer.MLAPI.Runtime.dll
Syntax
public static class SerializationManager
Methods
IsTypeSupported(Type)
Returns if a type is supported for serialization
Declaration
public static bool IsTypeSupported(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The type to check |
Returns
| Type | Description |
|---|---|
| bool | Whether or not the type is supported |
RegisterSerializationHandlers<T>(CustomSerializationDelegate<T>, CustomDeserializationDelegate<T>)
Registers a custom serialization and deserialization pair for a object. This is useful for writing objects that are behind the third party wall. Such as .NET types.
Declaration
public static void RegisterSerializationHandlers<T>(SerializationManager.CustomSerializationDelegate<T> onSerialize, SerializationManager.CustomDeserializationDelegate<T> onDeserialize)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializationManager.CustomSerializationDelegate<T> | onSerialize | The delegate to invoke to serialize the type. |
| SerializationManager.CustomDeserializationDelegate<T> | onDeserialize | The delegate to invoke to deserialize the type. |
Type Parameters
| Name | Description |
|---|---|
| T | The type to register. |
RemoveSerializationHandlers<T>()
Removes a serialization handler that was registered previously for a specific type. This will remove both the serialization and deserialization handler.
Declaration
public static bool RemoveSerializationHandlers<T>()
Returns
| Type | Description |
|---|---|
| bool | Whether or not either the serialization or deserialization handlers for the type was removed. |
Type Parameters
| Name | Description |
|---|---|
| T | The type for the serialization handlers to remove. |