docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class JsonSerialization

    A class to serialize and deserialize objects to JSON.

    Inheritance
    object
    JsonSerialization
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Cloud.Common
    Assembly: Unity.Cloud.Common.dll
    Syntax
    public static class JsonSerialization

    Methods

    Deserialize<T>(string)

    Deserialize a JSON string to a specified type.

    Declaration
    public static T? Deserialize<T>(string json)
    Parameters
    Type Name Description
    string json

    The JSON string to deserialize.

    Returns
    Type Description
    T

    The deserialized type if successful, or null if unsuccessful.

    Type Parameters
    Name Description
    T

    The type to deserialize to.

    Serialize<T>(T)

    Serialize a JSON string from a specified type.

    Declaration
    public static string Serialize<T>(T value)
    Parameters
    Type Name Description
    T value

    The object to serialize.

    Returns
    Type Description
    string

    The serialized JSON string.

    Type Parameters
    Name Description
    T

    The type to serialize.

    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)