using System.Collections; using System.Collections.Generic; using System.IO; using UnityEditor; using UnityEngine; public class TestJson : MonoBehaviour { // Use this for initialization void Start () { var files = System.IO.Directory.GetFiles(Application.dataPath + "/ShareSDKiOSAutoPackage/Editor/SDKPorter", "*.projmods", System.IO.SearchOption.AllDirectories); foreach (var file in files) { DeCodeJson(file); } } void DeCodeJson(string path) { FileInfo projectFileInfo = new FileInfo(path); if (!projectFileInfo.Exists) { Debug.LogWarning("File does not exist."); } string contents = projectFileInfo.OpenText().ReadToEnd(); var data = (Hashtable)MiniJSON.jsonDecode(contents); var log = MiniJSON.jsonEncode(data); Debug.LogWarning("LOG: " + log); } }