docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SerializationManager

    Helper class to manage the MLAPI serialization.

    Inheritance
    object
    SerializationManager
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)