安卓 通过www读取Application.persistentDataPath

博观而约取,厚积而薄发。这篇文章主要讲述安卓 通过www读取Application.persistentDataPath相关的知识,希望能为你提供帮助。
今天在读取Application.persistentDataPath路径下的图片时,在前面加上“ file:///” 例如
 

#if UNITY_EDITOR || UNITY_STANDALONE return "file:///" + Application.persistentDataPath + "1.jpg"; #elif UNITY_android return "file:///" +Application.persistentDataPath + "1.jpg"; #else return "file:///" +Application.persistentDataPath + "1.jpg"; #endif

 
搞了半天 www 加载 在前面加“ jar:file///” 没有用 不加也没有用,只有在前面加"file:///"才行;
 
另外  FileStream 读取文件时遇到一些问题
string ConfigurationFile= "";#if UNITY_EDITOR ConfigurationFile = Application.streamingAssetsPath + "/ConfigurationFile.txt"; #elif UNITY_ANDROID ConfigurationFile =Application.streamingAssetsPath + "/ConfigurationFile.txt"; #elif UNITY_STANDALONE ConfigurationFile = Application.streamingAssetsPath + "/ConfigurationFile.txt"; #endif FileStream file = new FileStream(ConfigurationFile, FileMode.Open);

 
【安卓 通过www读取Application.persistentDataPath】有没有发现 fileStream 地址不能加 file:///

    推荐阅读