docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method Serialize

    Serialize(object)

    Json serialization method that serialize a data object and return the data as object.

    Declaration
    public override 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

    Overrides
    DataSerializerBase.Serialize(object)

    Serialize(object, bool)

    Json serialization method that serialize a data object and return the data as string. Can use encryption.

    Declaration
    public override 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

    Overrides
    DataSerializerBase.Serialize(object, bool)

    Serialize<T>(T, Stream, bool)

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

    Declaration
    public override 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

    Overrides
    DataSerializerBase.Serialize<T>(T, Stream, bool)

    Serialize<T>(T, bool)

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

    Declaration
    public override 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

    Overrides
    DataSerializerBase.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)