๐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