What is better for text reading…
TextAsset content = Resources.Load("tempTextFile") as TextAsset;
string tempString = content.text;
or Using System.IO operations
using (FileStream fs = new FileStream(path, FileMode.Open))
{
using (StreamReader reader = new StreamReader(fs))
{
string tempString = reader.ReadToEnd();
reader.Close();
}
fs.Close();
}
The thing is that I need to write back in to the file as well… for that I eventually have to use System.IO operations … or is there a way in unity libraries for achieving that as well?