Unity路径点相关,会持续更新

1,streamingAssetsPath 可读不可写

1.在windows pc上可以使用www直接读取streamingAssetsPath路径下的文件。也可以使用File直接读取。
2.android上www可以读取streamingAssetsPath,但是使用file是读取不到的
3.mac上使用www读取不到streamingAssetsPath,可以使用file读取
4.ios上使用www读取不到streamingAssetsPath,可以使用file读取

2,Application.persistentDataPath

1.Application.persistentDataPath 是可读可写路径,一般热更资源放在这边
2. IOS中读取目录下的ab包
AssetBundleCreateRequest createRequest =

AssetBundle.LoadFromMemoryAsync(File.ReadAllBytes(Application.persistentDataPath + "/AssetBundles/IOS/翻译静态数>据"));
           yield return createRequest;
          AssetBundle bundle = createRequest.assetBundle;

在IOS中读取文本

Debug.Log("文件链接:" +  path + "/" + name);
      //            UnityWebRequest w = UnityWebRequest.Get(st+path + "/" + name);
     //                        new Task(ShowDownProgress(w));
    //w.SendWebRequest();
   FileStream fs = new FileStream( path + "/" + name, FileMode.Open, FileAccess.Read, FileShare.Read);//找到指定路径的文件,打开,读取;using自动释放资源并且关闭
       StreamReader sr = new StreamReader(fs, Encoding.Default);
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值