public void WriteSettingData(InitSettingData mInitSettingData) { //Test string json = JsonUtility.ToJson(mInitSettingData); byte[] jsonToBytes = Encoding.ASCII.GetBytes(json); File.WriteAllBytes(filePath, jsonToBytes); }
public InitSettingData ReadSettingData() { InitSettingData mInitSettingData = new InitSettingData(); byte[] jsonToBytes = File.ReadAllBytes(filePath); string json = Encoding.ASCII.GetString(jsonToBytes); mInitSettingData = JsonUtility.FromJson <InitSettingData>(json); return(mInitSettingData); }