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
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.Purchasing.MiniJSON
    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

    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

    A Dictionary<string, object> / List<object>

    Returns
    Type Description
    String

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

    Back to top
    Terms of use
    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