安卓 通过www读取Application.persistentDataPath 路径的文件问题
来源:互联网 发布:世界遗产地理杂志淘宝 编辑:程序博客网 时间:2024/06/17 02:43
今天在读取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
搞了半天 在前面加“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);
有没有发现 fileStream 地址不能加 file:///
- 安卓 通过www读取Application.persistentDataPath 路径的文件问题
- unity 安卓 如何读取 Application.persistentDataPath这个路径下面的assetbundle文件
- 坑爹的Application.persistentDataPath
- 安卓文件存在但是unity中通过www读取失败
- Application.persistentDataPath
- Application.persistentDataPath
- Application.persistentDataPath
- 【Unity&JSON】datapath和persistentDataPath文件路径的两种路径地址
- 关于安卓读取资源文件的问题
- JAVA读取文件的路径问题!
- WebLogic10读取文件路径的问题
- .properties文件读取时的路径问题
- java读取文件的路径问题
- Python 读取文件时的路径问题 .
- 一个通过自定义application管理安卓activity的例子
- iOS : 通过路径读取文件的几种方法
- Unity Application.persistentDataPath 空值
- Unity Application.persistentDataPath 为空
- 树状数组求逆序数
- 文章标题
- python机器学习实战(四)
- SQL基础语法(增删改查)和基本函数
- springMvc事务处理
- 安卓 通过www读取Application.persistentDataPath 路径的文件问题
- pat 1044. 火星数字
- C -- 结构体之位域
- 机器学习 数据特征分析 特征工程
- 冒泡排序法
- 遗传算法运用
- JAVA基本数据类型
- stopPropagation()方法阻止事件的向上传播?
- Libevent-2.1.8源码分析——内存管理