What is the best way to load all save files inside a folder?
What is the best way to load all save files inside a folder?
Hi there. I need to know what is the best way to load all save files inside a folder? Is there any better way than creating a list of all saved .es3 files?
Re: What is the best way to load all save files inside a folder?
Hi there,
To do this you can use ES3.GetFiles to get an array of filenames, and then iterate through these. It wouldn't be possible to do it without a loop like this because it would be impossible for Easy Save to know what you wanted to load from each file and how.
All the best,
Joel
To do this you can use ES3.GetFiles to get an array of filenames, and then iterate through these. It wouldn't be possible to do it without a loop like this because it would be impossible for Easy Save to know what you wanted to load from each file and how.
All the best,
Joel
Re: What is the best way to load all save files inside a folder?
Thank you. I didn't know about that but it takes .meta files too and makes array too big as those files are inside StreamingAssets folder.
Re: What is the best way to load all save files inside a folder?
Hi there,
You would need to check the extension before loading from it. I.e.
Note that the .meta files won't exist in your build.
All the best,
Joel
You would need to check the extension before loading from it. I.e.
Code: Select all
foreach(var filename in files)
{
if(filename.Contains(".meta"))
continue;
}
All the best,
Joel