using System; using System.Collections.Generic; using UnityEngine; using System.Text.RegularExpressions; [Serializable] public class LevelOnlineData { public string Version; public List Formations; public static LevelOnlineData JsonToData(string pJson) { LevelOnlineData tData = JsonUtility.FromJson(pJson); return tData; } public static string DataToJson(LevelOnlineData pData) { string tJson = JsonUtility.ToJson(pData); Regex tReg = new Regex(@"(?i)\\[uU]([0-9a-f]{4})"); tJson = tReg.Replace(tJson, delegate (Match m) { return ((char)Convert.ToInt32(m.Groups[1].Value, 16)).ToString(); }); return tJson; } }