Another method to load in text data is externally from the project, that is, from files on the local hard drive. Text Data loaded in this way is read into the project dynamically from script, not necessarily at scene startup, but whenever you execute the necessary code. This means that for longer text files that involve heavy processing, lag becomes a serious consideration. In general, therefore, it is best to prefer statically loaded Text Assets to dynamic forms. For any dynamic assets, I recommend that you load and process them at scene startup to avoid in-game lagging, as shown in the following code sample 6-26:
using UnityEngine;
using System.Collections;
using System.IO;
//Function to load text data from external file
public static string LoadTextFromFile(string Filename)
{
//If file does not exist on system, then return empty string
if(!File.Exists(Filename)) return string.Empty;
//File exists, now load text from file...