mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 19:34:47 +00:00
13 lines
328 B
C#
13 lines
328 B
C#
using Newtonsoft.Json;
|
|
|
|
namespace JNGame.Runtime.Util {
|
|
public static class JsonUtil {
|
|
public static string ToJson(object obj){
|
|
return JsonConvert.SerializeObject(obj);
|
|
}
|
|
|
|
public static T ToObject<T>(string txt){
|
|
return JsonConvert.DeserializeObject<T>(txt);
|
|
}
|
|
}
|
|
} |