I have a xml in ProjectFolder/Assets/ but I can’t load it on iOS.
Output windows print that file can’t be found.
I have tried different scripts to get file path but neither work, for example:
public static string GetiPhoneDocumentsPath ()
{
string path = Application.dataPath.Substring (0, Application.dataPath.Length - 5);
path = path.Substring(0, path.LastIndexOf('/'));
return path + "/Documents";
}
//-----------------------------------------------------------------------------
string fileNameBase = Application.dataPath.Substring(0, Application.dataPath.LastIndexOf('/'));
fileName = fileNameBase.Substring(0, fileNameBase.LastIndexOf('/')) + "/Documents/" + FILE_NAME;
//-----------------------------------------------------------------------------
string fileName = Application.persistentDataPath + "/" + FILE_NAME;
//-----------------------------------------------------------------------------
Path.Combine( Application.persistentDataPath, FILE_NAME);
So… what am I doing wrong? Do I have to change some settings in Unity Editor? Where do I have to put the xml file? How do I load a xml file on iPhone/iPad?