public T Decode <T>() { string path = Path.Combine(Application.persistentDataPath, _fileName); PersistentSave ps = new PersistentSave(_fileName); if (!File.Exists(path)) { StreamimgSave ss = new StreamimgSave(_fileName); T data = ss.LoadbyJson <T>(); // 未处理配置文件不存在的情况 ps.SaveByBin <T>(data); } return(ps.LoadByBin <T>()); }
// 数据保存 public bool Encode <T>(T s) { PersistentSave ps = new PersistentSave(_fileName); return(ps.SaveByBin <T>(s)); }