unity text file to string 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