public void LoadScriptables() { string filepath = Application.persistentDataPath + "/newsave.json"; if (File.Exists(filepath)) { string json = File.ReadAllText(filepath); JSON jsonObject = JSON.ParseString(json); SL = jsonObject.Deserialize <SerializableListString>(); } }
public void JSONLoad() { //filepath string filepath = Application.persistentDataPath + "/newsave.json"; if (File.Exists(filepath)) { //read in the file to a string string json = File.ReadAllText(filepath); //use the JSON library to parse the string JSON jsonObject = JSON.ParseString(json); //deserialize the JSON object back into our Serializable class SL = jsonObject.Deserialize <SerializableListString>(); } }