How can i list my saved games through UI?
Hi everyone, I use application.persistantdata and save my game. However, i cannot figure out how i can show the list of saved games i have in unity? Can anyone help me please?
There is no function Application.persistentdata
. There is however a Application.persistentDataPath
which is a path to the persistent data directory. From what you are asking I believe you are looking for something else.
I woulds suggest that you provide some script that shows how you are saving and loading your saved games if you want a helpful answer.
Yes i am using application.persistentDatapath. this is how i load it in Awake():
if (File.Exists(Application.persistentDataPath + "/" + imageName + ".dat"))
{
try
{
using (Stream stream = File.Open(Application.persistentDataPath + "/" + imageName + ".dat", File$$anonymous$$ode.Open))
{
allCells = new List<CellInfo>();
var bformatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
allCells = (List<CellInfo>)bformatter.Deserialize(stream);
}
}
catch
{
Debug.Log("Error: PostObject list loading...");
//TODO Load UserObject Again...
}
and this is how i save it ;
FileStream fs = new FileStream(Application.persistentDataPath + "/" + imageName + ".dat", File$$anonymous$$ode.Create);
BinaryFormatter bf = new BinaryFormatter();
PlayerPrefs.SetString("ImageName", imageName.ToString());
bf.Serialize(fs, allCells);
fs.Close();
my question is how can i make a list of the saved games and show it to the user so they can load up any of their game?
Your answer
![](https://koobas.hobune.stream/wayback/20220612102436im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
problem with loading data with serialization in the right time 0 Answers
How to make a save script in javascript. 1 Answer
How Would I Load A Level From A Gui Button Press 1 Answer
List to XML 0 Answers