void Start() { if (GUIManager.GetInst().tutorial == true) { font_list = FIleManager.Getinst().LoadTextData(path); } if (GUIManager.GetInst().talkmode) { font_list = FIleManager.Getinst().LoadTextData(GUIManager.GetInst().fontPath); } //LoadTextFile("text/data.txt"); text = GetComponent <TextMesh>(); if (GUIManager.GetInst().tutorial == true) { text.text = font_list.bonInfos[1].text; } maintext = maintext; }
public Fontlist LoadTextData(string path) { Fontlist font_list = new Fontlist(); // xmlFile.Load(MapPath); string strFile = path; string strPath = string.Empty; string strFilePath = Application.persistentDataPath + "/" + strFile; XmlDocument xmlFile = new XmlDocument(); if (Application.platform == RuntimePlatform.Android) { TextAsset textAsset = Resources.Load("XML/" + strFile) as TextAsset; xmlFile.LoadXml(textAsset.text); } else { string Path = Application.streamingAssetsPath + "/" + strFile + ".xml"; xmlFile.Load(Path); //xmlFile.Load(MapPath); } XmlNodeList hexes = xmlFile.SelectNodes("Text/text"); foreach (XmlNode hex in hexes) { string mapposStr = hex["textData"].InnerText; string[] sizes = mapposStr.Split(','); fontinfo font = new fontinfo(); font.text = sizes[0]; font.Who_say = sizes[1]; font.tesx_idx = int.Parse(sizes[2]); font_list.bonInfos.Add(font); } return(font_list); }