๐Ÿ“šJsonUtility

APIModule.MatchmakingResponse matchmakingResult 
= JsonUtility.FromJson<APIModule.MatchmakingResponse>(matchmakingResponse);
public struct MatchmakingResponse
{
    public string ticketId;

    public MatchmakingResponse(string ticketId)
    {
        this.ticketId = ticketId;
    }
}
using System;
using UnityEngine.Bindings;

namespace UnityEngine
{
    //
    // ์š”์•ฝ:
    //     Utility functions for working with JSON data.
    [NativeHeader("Modules/JSONSerialize/Public/JsonUtility.bindings.h")]
    public static class JsonUtility
    {
        public static T FromJson<T>(string json);
        //
        // ์š”์•ฝ:
        //     Create an object from its JSON representation.
        //
        // ๋งค๊ฐœ ๋ณ€์ˆ˜:
        //   json:
        //     The JSON representation of the object.
        //
        //   type:
        //     The type of object represented by the Json.
        //
        // ๋ฐ˜ํ™˜ ๊ฐ’:
        //     An instance of the object.
        public static object FromJson(string json, Type type);
        //
        // ์š”์•ฝ:
        //     Overwrite data in an object by reading from its JSON representation.
        //
        // ๋งค๊ฐœ ๋ณ€์ˆ˜:
        //   json:
        //     The JSON representation of the object.
        //
        //   objectToOverwrite:
        //     The object that should be overwritten.
        public static void FromJsonOverwrite(string json, object objectToOverwrite);
        //
        // ์š”์•ฝ:
        //     Generate a JSON representation of the public fields of an object.
        //
        // ๋งค๊ฐœ ๋ณ€์ˆ˜:
        //   obj:
        //     The object to convert to JSON form.
        //
        //   prettyPrint:
        //     If true, format the output for readability. If false, format the output for minimum
        //     size. Default is false.
        //
        // ๋ฐ˜ํ™˜ ๊ฐ’:
        //     The object's data in JSON format.
        public static string ToJson(object obj);
        //
        // ์š”์•ฝ:
        //     Generate a JSON representation of the public fields of an object.
        //
        // ๋งค๊ฐœ ๋ณ€์ˆ˜:
        //   obj:
        //     The object to convert to JSON form.
        //
        //   prettyPrint:
        //     If true, format the output for readability. If false, format the output for minimum
        //     size. Default is false.
        //
        // ๋ฐ˜ํ™˜ ๊ฐ’:
        //     The object's data in JSON format.
        public static string ToJson(object obj, bool prettyPrint);
    }
}

Last updated