Want to ask do unity have a system that can look through the saved folder to see got how many file that been saved as json, and than create a gui for each of the saved json.
void Start()
{
string saveName = "/" + name.text.ToString() + ".save";
}
private Save CreateSaveData()
{
Save save = new Save ();
save.intListVariable_ = anyScript.ListsOfVariable;
return save;
}
public void SaveAsJSON()
{
Save save = CreateSaveData ();
string json = JsonUtility.ToJson (save);
string filePath = Application.dataPath + saveName;
File.WriteAllText (filePath, json);
//Debug.Log ("Saving as JSON: " + json);
}
public void LoadFromJSON()
{
string filePath = Application.dataPath + saveName;
if (File.Exists (filePath))
{
string json = File.ReadAllText (filePath);
Save save = JsonUtility.FromJson<Save> (json);
anyScript.ListsOfVariable = save.intListVariable_;
//Debug.Log ("Saving Variable Loaded");
}
else
{
//Debug.Log ("No Saving Variable Saved");
}
}
Above is the example that i save the file as json, because i let the player type their wanted name so this can let the player create multiple save data.
But now the problem is how i going to load the data and because having multiple save json data and also because the save name is typed by the player so cannot load by the name, how i can load all of them and create gui for them?