安卓 通过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);
有没有发现 fileStream 地址不能加 file:///
安卓 通过www读取Application.persistentDataPath的更多相关文章
- 安卓中webview读取html,同时嵌入Flex的SWF,交互
安卓中webview读取html,同时嵌入Flex的SWF,交互 安卓activity与html交互很简单,用javascript接口即可,网上一堆的例子,基本上没多大问题. 在html里面嵌入swf ...
- (转)Unity3D研究院之手游开发中所有特殊的文件夹(assetbundle与Application.persistentDataPath)
这里列举出手游开发中用到了所有特殊文件夹. 1.Editor Editor文件夹可以在根目录下,也可以在子目录里,只要名子叫Editor就可以.比如目录:/xxx/xxx/Editor 和 /Edi ...
- Application.persistentDataPath 的一个小坑
打包之前在Android的Player Setting里面选择WriteAccess (写入访问) Internal Only:表示Application.persistentDataPath的路径是 ...
- SpringBoot读取application.properties文件
http://blog.csdn.net/cloume/article/details/52538626 Spring Boot中使用自定义的properties Spring Boot的applic ...
- SpringBoot(十):读取application.yml下配置参数信息,java -jar启动时项目修改参数
读取application.yml下配置参数信息 在application.yml文件内容 my: remote-address: 192.168.1.1 yarn: weburl: http://1 ...
- spring boot 无法读取application.properties问题
spring boot 无法读取application.properties问题 https://bbs.csdn.net/topics/392374488 Spring Boot 之注解@Compo ...
- SpringBoot在logback.xml中读取application.properties中配置的日志路径
1.在springboot项目中使用logback记录日志,在logback.xml中配置日志存储位置时读取application.properties中配置的路径,在 logback.xml中配置引 ...
- springboot:读取application.yml文件
现在开发主要使用微服务框架springboot,在springboot中经常遇到读取application.yml文件的情形. 一.概述 开发过程中经常遇到要读取application.yml文件中的 ...
- Ligg.EasyWinApp-101-Ligg.EasyWinForm: Application--启动,传入参数、读取Application级别配置文件、验证密码、软件封面、启动登录、StartForm
首先请在VS里打开下面的文件,我们将对源码分段进行说明: 步骤1:读取debug.ini文件 首先读取当前文件夹(.\Clients\Form)的debug.ini文件,该文件的args用于调试时传参 ...
随机推荐
- USACO08MAR土地购买 与 APIO2010特别行动队
两道斜率优化DP: 土地购买 约翰准备扩大他的农场,眼前他正在考虑购买N块长方形的土地.如果约翰单买一块土 地,价格就是土地的面积.但他可以选择并购一组土地,并购的价格为这些土地中最大的长 乘以最大的 ...
- ThreeJs 选中物体事件
选中物体变红色demo: https://threejs.org/examples/#webgl_raycast_sprite <!DOCTYPE html> <html lang= ...
- 04.CSS选择器-->相邻、通用兄弟选择器
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- PHP开发支付宝之电脑网站支付--流程简介
前言 前端时间自己开发了一个drupal的支付宝模块,现在整理一下过程,因为支付宝官方网站提供的接口及文档都是新接口的,而且使用新接口的过程比较麻烦一点,所以整理一下 1.支付宝的账号必须经过企业资格 ...
- 线性表接口的实现_Java
线性表是其组成元素间具有线性关系的一种线性结构,对线性表的基本操作主要有插入.删除.查找.替换等,这些操作可以在线性表的任何位置进行.线性表可以采用顺序存储结构和链式存储结构表示. 本接口的类属于da ...
- JS 根据子网掩码,网关计算出所有的IP范围
// 验证IP的正则 var ip_reg = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0- ...
- HTML5盒子模型。
盒子模型. 盒子由 margin.border.padding.content 四部分组成. margin :外边距 border:边框 padding:内边距 (内容与边框的距离) content: ...
- 【SQL server 2012】复制数据库到另一台机器上
当需要将一台机器(源机器)上的一个数据库完全复制到另一台机器(目标机器)上时,可以选择先在源机器上备份该数据库,然后在目标机器上还原该备份的方法. 下面详细描述具体步骤: 1. 打开SQL serve ...
- django定义Model中的方法和属性
#定义一个Model class UserProfile(models.Model): user=models.OneToOneField(User,unique=True) phone=models ...
- Python学习---django下的Session操作 180205
和Cookie一样,都是用来进行用户认证.不同的是,Cookie可以吧明文/密文的信息都会KV返回给客户段,但是session可以吧用户的Value[敏感信息]保存在服务器端,安全. Django中默 ...