Class Json | Asset Graph | 1.6.0-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Class Json

    This class encodes and decodes JSON strings. Spec. details, see http://www.json.org/

    JSON uses Arrays and Objects. These correspond here to the datatypes IList and IDictionary. All numbers are parsed to doubles.

    Inheritance
    Object
    Json
    Namespace: AssetBundleGraph
    Syntax
    public static class Json

    Methods

    Deserialize(String)

    Parses the string json into a value

    Declaration
    public static object Deserialize(string json)
    Parameters
    Type Name Description
    String json

    A JSON string.

    Returns
    Type Description
    Object

    An List<object>, a Dictionary<string, object>, a double, an integer,a string, null, true, or false

    Prettify(String)

    Declaration
    public static string Prettify(string sourceJson)
    Parameters
    Type Name Description
    String sourceJson
    Returns
    Type Description
    String

    Serialize(Object)

    Converts a IDictionary / IList object or a simple type (string, int, etc.) into a JSON string

    Declaration
    public static string Serialize(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    String

    A JSON encoded string, or null if object 'json' is not serializable

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023