I am storing the progress of the game in XML file. Since the player can choose the round they want to play, but not repeat a round once completed. The files are being editte
The good news: in Unity it's extremely easy to save/read text files.
The key point...
(A) There is utterly no reason, whatsoever, to use any other folders or paths.
(B) Indeed, you simply can not use any other folders or paths.
It's this easy to write and read files in Unity.
using System.IO;
// IO crib sheet..
//
// get the file path:
// f = Application.persistentDataPath+"/"+fileName;
//
// check if file exists: System.IO.File.Exists(f)
// write to file: File.WriteAllText(f,t)
// delete the file if needed: File.Delete(f)
// read from a file: File.ReadAllText(f)
That's all there is to it.
string currentText = File.ReadAllText(filePath);
Regarding the question here, "should I add them manually on the first run"
It's simple ...
public string GetThatXMLStuff()
{
f = Application.persistentDataPath+"/"+"defaults.txt";
// check if it already exists:
if ( ! System.IO.File.Exists(f) )
{
// First run. Put in the default file
string default = "First line of file.\n\n";
File.WriteAllText(f, default);
}
// You know it exists no matter what. Just get the text:
return File.ReadAllText(f);
}
It's really that simple - nothing to it.