textAst //动态获取的textasset
//用流读取
MemoryStream ms = new MemoryStream(textAst.bytes);
StreamReader sr = new StreamReader(ms);
while (sr.Peek() >= 0)
{
string lineContent = sr.ReadLine();
if (string.IsNullOrEmpty(lineContent))
break;
GfLanguage gfLan = LanguageAnalysis(lineContent, true);
if (!GameData.listLanguageInfo.ContainsKey(gfLan.id))
GameData.listLanguageInfo.Add(gfLan.id, gfLan);
}
sr.Dispose();
ms.Dispose();
Resources.UnloadAsset(textAst);
原文:https://www.cnblogs.com/mcyushao/p/14705854.html