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

  

最新文章

  1. 基于 HTML5 的 Web SCADA 报表
  2. POJ 2251 BFS(简单)
  3. 解读JSP的解析过程
  4. 函数对象适配器之ptr_fun的使用示例
  5. 【linux】文字提取
  6. PHPCMS V9添加模板自定义全局变量
  7. 进程产生的三种方式:fork、system和exec
  8. Android Animation ---TranslateAnimation
  9. linux常用命令及安装软件命令
  10. 一个少了context的赋值的错误
  11. 1. android
  12. [转载]cookie
  13. Warensoft Stock Service Api客户端接口说明
  14. DIV正确打开方式 ~~~~哈哈哈
  15. [转帖]你云我云•兄弟夜谈会 第三季 企业IT架构
  16. 根据指定的key,将二维数组的value转换为string,适用于mysql的in查询
  17. STARTTLS is required but host does not support STARTTLS
  18. 第二章 使用unittest模块扩展功能测试
  19. linux 3.10 的又一次hung
  20. shiro 密码的MD5盐值加密

热门文章

  1. ntp.log日志梳理
  2. windows下Word使用-快捷键
  3. Laravel源码解析之从入口开始
  4. [luogu] P3745 [六省联考2017]期末考试 (贪心)
  5. js常用特效-幻灯片
  6. sql 语句中的 (+) 是什么意思?
  7. mysql数据实时同步到Elasticsearch
  8. Windows里正确安装Zookeeper以服务运行
  9. 程序猿的量化交易之路(21)--Cointrader之Currency货币实体(9)
  10. 【Linux】进程调度概述