今天在读取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);

有没有发现 fileStream 地址不能加 file:///

安卓 通过www读取Application.persistentDataPath的更多相关文章

  1. 安卓中webview读取html,同时嵌入Flex的SWF,交互

    安卓中webview读取html,同时嵌入Flex的SWF,交互 安卓activity与html交互很简单,用javascript接口即可,网上一堆的例子,基本上没多大问题. 在html里面嵌入swf ...

  2. (转)Unity3D研究院之手游开发中所有特殊的文件夹(assetbundle与Application.persistentDataPath)

    这里列举出手游开发中用到了所有特殊文件夹. 1.Editor Editor文件夹可以在根目录下,也可以在子目录里,只要名子叫Editor就可以.比如目录:/xxx/xxx/Editor  和 /Edi ...

  3. Application.persistentDataPath 的一个小坑

    打包之前在Android的Player Setting里面选择WriteAccess (写入访问) Internal Only:表示Application.persistentDataPath的路径是 ...

  4. SpringBoot读取application.properties文件

    http://blog.csdn.net/cloume/article/details/52538626 Spring Boot中使用自定义的properties Spring Boot的applic ...

  5. SpringBoot(十):读取application.yml下配置参数信息,java -jar启动时项目修改参数

    读取application.yml下配置参数信息 在application.yml文件内容 my: remote-address: 192.168.1.1 yarn: weburl: http://1 ...

  6. spring boot 无法读取application.properties问题

    spring boot 无法读取application.properties问题 https://bbs.csdn.net/topics/392374488 Spring Boot 之注解@Compo ...

  7. SpringBoot在logback.xml中读取application.properties中配置的日志路径

    1.在springboot项目中使用logback记录日志,在logback.xml中配置日志存储位置时读取application.properties中配置的路径,在 logback.xml中配置引 ...

  8. springboot:读取application.yml文件

    现在开发主要使用微服务框架springboot,在springboot中经常遇到读取application.yml文件的情形. 一.概述 开发过程中经常遇到要读取application.yml文件中的 ...

  9. Ligg.EasyWinApp-101-Ligg.EasyWinForm: Application--启动,传入参数、读取Application级别配置文件、验证密码、软件封面、启动登录、StartForm

    首先请在VS里打开下面的文件,我们将对源码分段进行说明: 步骤1:读取debug.ini文件 首先读取当前文件夹(.\Clients\Form)的debug.ini文件,该文件的args用于调试时传参 ...

随机推荐

  1. JQuery图片加载显示loading和加载失败默认图片

    在很多时候我们需要用到图片加载功能,在网上搜资料后就想为了以后使用方便重新整理了下,结果如图: 最后一张是加载失败显示的图片,没找到合适的图片,先用他顶替. 页面引用 <div class=&q ...

  2. cache2go开源项目的回调方法使用

    https://github.com/muesli/cache2go 结构体 type CacheTable struct { sync.RWMutex . name string items map ...

  3. SQLServer2008或SQLServer2008 R2没有智能提示解决方法

    如果没有智能提示,需要安装SqlcompletefreeSQL Server智能提示

  4. DAO层,Service层,Controller层、View层介绍

    来自:http://jonsion.javaeye.com/blog/592335 DAO层 DAO 层主要是做数据持久层的工作,负责与数据库进行联络的一些任务都封装在此,DAO层的设计首先是设计DA ...

  5. Javascript 中 true 和 false

    "" == false // true "0" == false // true "" == "0" //false 以 ...

  6. Win10笔记本显卡驱动更新升级

    对于游戏玩家来说,对显卡的关注度要高于电脑其它硬件,一般来说,显卡越好,游戏性能往往越强.不过要持续发挥显卡的最佳游戏性能,经常更新显卡驱动也是很有必要的.那么笔记本显卡驱动怎么更新?下面小编以自己的 ...

  7. RESTful的理解与设计【PHP】

    RESTful 就是一种软件架构的风格,以资源为中心定位,运用http的请求方式(动词)来划定操作.这样的设定优点简单易理解,方便人员对接,形成规范. 资源作为唯一标识,使用相关动词取获取操作.举例, ...

  8. C/S架构的性能测试

    很多人关心LR在C/S架构上如何实施性能测试,我想根本原因在于两个方面,一是很多时候脚本无法录制,即LR无法成功调用被测的应用程序,二是测试脚本即使录制下来,可读性不强,往往不能运行通过,调试时无从下 ...

  9. August 12th 2017 Week 32nd Saturday

    That which does not kill us makes us stronger. 但凡不能杀死你的,最终都会使你更强大. Seemingly I have heard this from ...

  10. 7、Node.js EventEmitter

    #######################################################################################介绍Node.js Eve ...