docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method Serialize

    Serialize(object)

    Public abstraction of the serialize method that serialize a data object and return the data as object.

    Declaration
    public abstract object Serialize(object data)
    Parameters
    Type Name Description
    object data

    The data object to serialize

    Returns
    Type Description
    object

    The serialized data as an object

    Implements
    IDataSerializer.Serialize(object)

    Serialize(object, bool)

    Public abstraction of the serialize method that serialize a data object and return the data as string. Can use encryption.

    Declaration
    public abstract string Serialize(object data, bool encrypted = false)
    Parameters
    Type Name Description
    object data

    The data object to serialize

    bool encrypted

    Is the serialization encrypted

    Returns
    Type Description
    string

    The serialized data as an string

    Implements
    IDataSerializer.Serialize(object, bool)

    Serialize<T>(T, Stream, bool)

    Public abstraction of the serialize method that serialize the data of a generic type T and write the data through a stream. Can use encryption.

    Declaration
    public abstract void Serialize<T>(T data, Stream stream, bool encrypted = false)
    Parameters
    Type Name Description
    T data

    The data as type T to serialize

    Stream stream

    The stream through which the serialization is supposed to be written

    bool encrypted

    Is the serialization encrypted

    Type Parameters
    Name Description
    T

    The type of the data to be serialized

    Implements
    IDataSerializer.Serialize<T>(T, Stream, bool)

    Serialize<T>(T, bool)

    Public abstraction of the serialize method that serialize the data of a generic type T and return the data as string. Can use encryption.

    Declaration
    public abstract string Serialize<T>(T data, bool encrypted = false)
    Parameters
    Type Name Description
    T data

    The data as type T to serialize

    bool encrypted

    Is the serialization encrypted

    Returns
    Type Description
    string

    The serialized data as an string

    Type Parameters
    Name Description
    T

    The type of the data to be serialized

    Implements
    IDataSerializer.Serialize<T>(T, bool)
    In This Article
    Back to top
    Copyright © 2024 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)