write data to file c# unity code example
Example: unity read text file
// This is how I read a textfile, contained within the Resources
// folder:
TextAsset textFile;
string text;
string[] lines;
textFile = Resources.Load(fileName) as TextAsset; // Loads file
text = textFile.ToString(); // Converts to string
lines = text.Split('\n'); // Splits per newline
// Do something with it