unity Android在streamingAssets路径下文件无法读取的的解决方法
unity Android在streamingAssets路径下文件,有时候plugin下的.jar或者.so无法直接读取;
解决方法之一,拷贝至其他路径:
#if UNITY_ANDROID
string s = Application.streamingAssetsPath + "/s/ss.txt";
string filePath = Application.persistentDataPath + "/s";
if (!File.Exists(filePath+ "/ss.txt"))
{
using (WWW www = new WWW(s))
{
yield return www;
if (!string.IsNullOrEmpty(www.error))
{
Debug.Log(www.error);
}
else
{
if (!Directory.Exists(filePath))
{
//创建文件夹
Directory.CreateDirectory(filePath);
}
File.WriteAllBytes(filePath+ "/ss.txt", www.bytes);
}
}
} #endif
unity Android在streamingAssets路径下文件无法读取的的解决方法的更多相关文章
- java监控指定路径下文件及文件夹变化
之前用jdk7的WatchService API(java.nio.file包)来做目录下的子文件监控,后改为使用commons-io包.主要有下面几点不同:1. WatchService是采用扫描式 ...
- SpringBoot读取Linux服务器某路径下文件\读取项目Resource下文件
// SpringBoot读取Linux服务器某路径下文件 public String messageToRouted() { File file = null; try { file = Resou ...
- java获取类路径下文件的绝对路径
获取文件绝对路径 在idea中,默认的当前路径是project的根路径,如果你使用idea的默认路径,只要离开idea换到其他位置,可能当前路径就不是project的根路径了. 使用一下通用方式的前提 ...
- Android Studio2.x版本无法自动关联源码的解决方法
Android Studio2.x版本无法自动关联源码的解决方法 在学习android开发过程中,对于一个不熟悉的类,阅读源码是一个很好的学习方式,使用andorid studio开发工具的SDK M ...
- Android 打开方式选定后默认了改不回来?解决方法(三星s7为例)
Android 打开方式选定后默认了改不回来?解决方法(三星s7为例) 刚刚在测试东西,打开一个gif图,然后我故意选择用支付宝打开,然后...支付宝当然不支持,我觉得第二次打开它应该还会问我,没想到 ...
- 我的Android进阶之旅------>Android编译错误java.util.zip.ZipException: duplicate entry的解决方法
今天在Android Studio中把另外一个项目引入当前项目,编译的时候出现了java.util.zip.ZipException: duplicate entry错误. 错误如下所示: FAILU ...
- 我的Android进阶之旅------>Android编译错误java.util.zip.ZipException: duplicate entry的解决方法
今天在Android Studio中把另外一个项目引入当前项目,编译的时候出现了java.util.zip.ZipException: duplicate entry错误. 错误例如以下所看到的: F ...
- [转]win7下apache2.4响应很慢解决方法
win7下apache2.4响应很慢解决方法 PS.按照以下方法测试了以下,似乎确实快了一点[skysowe] 转载自: http://blog.sina.com.cn/s/blog_75ad1010 ...
- Tomcat 在win7/win8 系统下tomcat-users.xml.new(拒绝访问)解决方法
tomcat启动报错No UserDatabase component found under key UserDatabase 也可以这样处理 Tomcat 在win7/win8 系统下tomcat ...
随机推荐
- 新手学python-Day3-模块
模块就是引入别人写的,官方写的工具库,就像扳手,钳子,电锯
- Docker 管理工具的选择:Kubernetes 还是 Swarm?
[编者的话]选择Kubernetes 或者 Swarm 就像在将 Linux 桌面发行版的范围缩小到两个后选出一个最喜欢的.哪个更满足你的需要如何才是决定因素. [3 天烧脑式基于Docker的CI/ ...
- POJ——T1125 Stockbroker Grapevine
http://poj.org/problem?id=1125 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 36045 ...
- com.alibaba.fastjson.JSONPathException: expect '], but 'y'
今天遇到这样的一个错误 网上查找了各种资料,终于找到了报错的原因: String dataType = (String) JSONPath.eval(dataset.getSchema(), &quo ...
- [Puppeteer] Get a Page's Load Time with Puppeteer (window.profermence.timing)
In this lesson we are going to use Google's Puppeteer to gather metrics about a page's load time. We ...
- [ReactVR] Animate Text, Images, Views, and 3D Elements Using the Animated Library in React VR
Motion is an important aspect of a complete immersive experience, therefor we are going to look into ...
- caffe环境配置2
参考链接: http://blog.csdn.net/enjoyyl/article/details/47397505 http://blog.csdn.net/baobei0112/article/ ...
- Pocket英语语法---四、should的同义词是谁
Pocket英语语法---四.should的同义词是谁 一.总结 一句话总结:should表示劝告,建议,命令,其同义词是ought to,should强调主观看法,ought to强调客观要求.在疑 ...
- maven关于pom文件配置详解(转载)
转载:http://www.cnblogs.com/hafiz <project xmlns="http://maven.apache.org/POM/4.0.0" xmln ...
- xBIM 基础05 3D墙案例
系列目录 [已更新最新开发文章,点击查看详细] 使用编码的形式去生成一堵墙的模型需要做很多的工作. using System; using System.Collections.Generic ...