public void LoadNet() { SaveNetData dat = LoadDat(dataPath); SetBrokerPrefs(dat.BrokerAdres, dat.BrokerPort); ipfiled.text = dat.BrokerAdres; portfiled.text = dat.BrokerPort; }
static void SaveNetData(SaveNetData data, string path) { string jsonString = JsonUtility.ToJson(data); using (StreamWriter streamWriter = File.CreateText(path)) { streamWriter.Write(jsonString); } }
public void ChangePrefs() { SetBrokerPrefs(ipfiled.text, portfiled.text); SaveNetData dat = new SaveNetData(); dat.BrokerAdres = ipfiled.text; dat.BrokerPort = portfiled.text; SaveNetData(dat, dataPath); }