zoukankan      html  css  js  c++  java
  • unity 加载Assetbundle文件夹路径需要注意

    unity2017:  

    测试时 在Editor下加载Assetbundle文件夹下路径成功 在Android下使用www一直失败 使用Assetbundle.loadfromfile可以

      发现:加载Assetbundle文件       使用AssetBundle.LoadFromFile的路径是path,那么使用www加载需要前缀 "File://"+path才可以 ( Application.persistentDataPath;)

         加载StreamAssets路径下同理,  www需要加前缀 "jar:File://";   ( Application.dataPath + "/!/assets")

        AssetBundle.LoadFromFile不需要前缀:

       ------------------20180320更新------------------

    AssetBundle.LoadFromFile对于Android有无前缀都无所谓。

       string pathTest0 = Application.dataPath + "!assets" + "/"+ fileName0;   //0 ok:/data/app/ttt.tta.taw-2/base.apk!assets/mapdata.unity3d

       string pathTest3 = Application.streamingAssetsPath + "/"+ fileName0;  // 3 ok:jar:file:///data/app/ttt.tta.taw-2/base.apk!/assets/mapdata.unity3d

    这两个路径都是对的 虽然 3多了 3 ok:jar:file:///前缀

    unity文档解释Application.streamingAssetsPath中Android有误   

     注意 pathTest0中"!assets"内没有/

    改变自己
  • 相关阅读:
    Educational Codeforces Round 49 (Rated for Div. 2)
    Codeforces Round #506 (Div. 3)
    multiset
    C++中substr函数的用法
    7.30 背包问题
    7.29 dp动态规划
    7.27 图论 存图 前向星 最短路 dijstra算法 SPFA算法
    7.26 搜索进阶(状压搜索,迭代加深搜索)
    7.23 深搜广搜
    7.24 二分搜索
  • 原文地址:https://www.cnblogs.com/sun-shadow/p/8497026.html
Copyright © 2011-2022 走看看