//PackFileをロードします public bool LoadFile(LanguagePackFile file, bool dontDestroyOnLoad) { LanguagePack pack = new LanguagePack(dontDestroyOnLoad); string labelKey = null; List <string> textList = null; string text = null; try { string filePath = Application.dataPath + "/" + file.packFileName; //Debug.Log(filePath); //FileInfo fileInfo = new FileInfo(filePath); //StreamReader streamReader = new StreamReader(fileInfo.Open(FileMode.Open, FileAccess.Read), Encoding.UTF8); using (StreamReader reader = new StreamReader(@filePath, Encoding.UTF8)) { string line; while ((line = reader.ReadLine()) != null) { if (line.StartsWith(LabelToken)) { if (text != null) { textList.Add(text); } if (textList != null) { pack.AddLable(labelKey, textList); } labelKey = line.Substring(LabelToken.Length).Trim(); textList = new List <string>(); text = null; continue; } if (line.StartsWith(ListToken)) { if (text != null) { textList.Add(text); } text = DecodeLine(line.Substring(ListToken.Length)); continue; } text += DecodeLine(line); } if (text != null) { textList.Add(text); } if (textList != null) { pack.AddLable(labelKey, textList); } reader.Close(); } languagePackList.Add(pack); return(true); } catch (System.Exception e) { Debug.LogWarning("LanguagePackManager.LoadFiles >> Failed: " + e.Message); return(false); } }