using SMHFramework.Helper; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using Utility; //============================================================ //支持中文,文件使用UTF-8编码 //@author YangHua //@create 20230920 //@company Adam // //@description: //============================================================ namespace Adam { public class TTTTT : MonoBehaviour { string path; public TEst t; public void Start() { path = Application.dataPath + "/StreamingAssets/" + "TT.json"; TEst t = new TEst(); t.name = "TTT"; JsonHelper.WriteJsonToFile(path, t); } private void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { t = new TEst(); string json = JsonHelper.GetJson(t); Debug.Log(json); } } } [Serializable] public class TEst { public string name; } }