AssetBundle 在Android机子上进行读取
2016-03-01 14:27
330 查看
我看到官方文档中说明:
Note that bundles are not fully compatible between platforms.
A bundle built for any of the standalone platforms (including webplayer) can be loaded on any of those platforms but not on iOS or Android.
Furthermore, a bundle built for iOS is not compatible with Android and vice versa.
但是我们看到,用以下步骤进行在Android机子上使用AssetBundle
重点有2点:
Use the option "BuildTarget.Android".
Describe the path with triple slash "file:///"
以下是步骤:
Delete directories "Per Texture Materials", "assetbundles", and so on. 把已经导出过的包删掉
Use the option "BuildTarget.Android" to all "BuildPipeline.BuildAssetBundle". 要把BuildTarget为Android平台!!!
Run these on Editor. Character Generator/Generate Materials Character Generator/Create Assetbundles Character Generator/Update Character Element Database
Copy Assetbundles database to Android device which like "/mnt/sdcard/assetbundles/" 把这些包放到Android的指定目录下
Modify AssetbundleBaseURL. (the point was "file:///") 修改获取AssetbundleBaseURL基础路径的地址
我看到官方文档中说明:
Note that bundles are not fully compatible between platforms.
A bundle built for any of the standalone platforms (including webplayer) can be loaded on any of those platforms but not on iOS or Android.
Furthermore, a bundle built for iOS is not compatible with Android and vice versa.
但是我们看到,用以下步骤进行在Android机子上使用AssetBundle
重点有2点:
Use the option "BuildTarget.Android".
Describe the path with triple slash "file:///"
以下是步骤:
Delete directories "Per Texture Materials", "assetbundles", and so on. 把已经导出过的包删掉
Use the option "BuildTarget.Android" to all "BuildPipeline.BuildAssetBundle". 要把BuildTarget为Android平台!!!
Run these on Editor. Character Generator/Generate Materials Character Generator/Create Assetbundles Character Generator/Update Character Element Database
Copy Assetbundles database to Android device which like "/mnt/sdcard/assetbundles/" 把这些包放到Android的指定目录下
Modify AssetbundleBaseURL. (the point was "file:///") 修改获取AssetbundleBaseURL基础路径的地址
public static string AssetbundleBaseURL { get { if (Application.platform == RuntimePlatform.WindowsWebPlayer || Application.platform == RuntimePlatform.OSXWebPlayer) { return Application.dataPath + "/assetbundles/"; } else if (Application.platform == RuntimePlatform.Android) { return "file:///mnt/sdcard/assetbundles/"; } else { return "file://" + Application.dataPath + "/../assetbundles/"; } } }
相关文章推荐
- android 自定义Alertdialog对话框用于耗时加载
- Android开源项目第二篇——工具库篇
- android媒体--stagefright概述【一】
- Android Timer的自动功能
- BroadcastReceiver的两种注册方式(静态注册和动态注册)android开发教程
- Android刮刮卡原理及实现
- Android笔记(二)SpannableString显示表情
- Android项目Tab类型主界面大总结 Fragment+TabPageIndicator+ViewPager
- Android可动态改变compoundDrawable颜色的TextView
- Android中的系统广播集合
- Android中的静态系统广播和动态系统广播
- android开发 wifi开发不稳定性测试
- 60条Android日常开发总结的技术经验
- Android提供的支持不同屏幕大小的全部方法
- android之JNI开发步骤总结
- android中使用jni对字符串加解密实现分析
- Android 系统应用 注意的那些事
- android中View.measure方法详解
- Android-笔记-160301
- Android中的Looper类