AssetBundle.CreateFromFile使用时注意事项
来源:互联网 发布:c语言中求绝对值 编辑:程序博客网 时间:2024/06/09 17:05
在使用AssetBundle.CreateFromFile加载AssetBundle时有两点需要注意:
1:在创建资源包时需要选择不压缩(unity5.x资源打包方式)
AssetBundleManifest amf = BuildPipeline.BuildAssetBundles(assetPath , abbs ,BuildAssetBundleOptions.UncompressedAssetBundle , bTarget);
2:在读取时需要注意文件路径
如果打的 AssetBundle 包b.unity3d放在工程目录下的asb文件夹下,则此时路径为:Application.dataPath + "/ASB/b.unity3d"
AssetBundle asb = AssetBundle.CreateFromFile(Application.dataPath + "/ASB/b.unity3d");
若使用www加载本地AssetBundle则需要在路径前加“file://”即
"file://" + Application.dataPath + "/ASB/b.unity3d"
StreamingAssets目录下的资源不同平台的路径:
#if UNITY_EDITOR#if UNITY_EDITOR_OSXpath = "file://" + Application.streamingAssetsPath+"/ASB_Ios/sound.unity3d";#elsepath = "file://" + Application.streamingAssetsPath+"/ASB_Android/sound.unity3d";#endif#elif UNITY_ANDROIDpath = Application.streamingAssetsPath+"/ASB_Android/sound.unity3d";#elif UNITY_IOSpath = "file://"+Application.streamingAssetsPath+"/ASB_Ios/sound.unity3d";//path = "file://"+Application.dataPath + "/Raw/ASB_Ios/sound.unity3d";// + filename;#elsepath = Application.streamingAssetsPath+"/ASB_Android/sound.unity3d";#endif
:
0 0
- AssetBundle.CreateFromFile使用时注意事项
- Unity3d 4.6版本时assetbundle.createFromFile的问题
- AssetBundle.CreateFromFile的有趣事情
- Unity3d 同步加载 Assetbundle 方法 AssetBundle.CreateFromFile
- Unity3d 同步加载 Assetbundle 方法 AssetBundle.CreateFromFile
- 【Unity3d】关于AssetBundle.CreateFromFile()方法加载资源失败解决方法
- Unity中Shader和AssetBundle结合使用的注意事项
- 使用Assetbundle时可能遇到的坑
- 使用Assetbundle时可能遇到的坑
- Unity AssetBundle的使用
- AssetBundle使用注意
- AssetBundle的初步使用
- [译]使用AssetBundle Manader
- 新版AssetBundle使用
- AssetBundle使用,卸载,校验
- unity3d开发2d游戏时注意使用Assetbundle
- 【Unity3D自学记录】使用assetbundle时可能遇到的坑
- 你在使用assetbundle时可能遇到的坑
- 【leetcode】 46. Permutations ,python实现
- JAVA使用Calendar操作Date
- Qt5打印功能示例代码
- 特征工程-降维
- 创建存储过程
- AssetBundle.CreateFromFile使用时注意事项
- MFC自定义消息
- Html5 获取手机短信号码
- TCP/IP详解——概述
- golang 中AES加密详解
- Struts与Spring整合实现用户登录
- ruby 文件操作
- google glog 简单使用小结
- string类为什么是final的