In a previous game, I had a subtitles script that loaded from an XML file in the Streaming Assets folder, and it worked great in Unity 4.6. However, in my new game using 5.3.2, it doesn’t seem to be working even though I’m not getting any compiler errors. Could one of you check this code and see if it looks right to you? Any help would be amazing. Thanks so much!
public static void loadFromXML(string file = "Subtitles.xml")
{
string path = Application.streamingAssetsPath;
string fullPath = Path.Combine(path, file);
if (!File.Exists(fullPath)) {
Debug.Log("Could not load file from : " + fullPath);
return;
}
string fileData = File.ReadAllText(fullPath);
XmlDocument root = new XmlDocument();
root.LoadXml(fileData);