Unity Editor下选定单个资源文件打AssetBundle
2017-07-14 16:59
661 查看
对Project视图中鼠标选中的单个资源文件(场景,Prefab等)进行打包
//菜单栏 [MenuItem("BuildBundle/Build One Selected Obj Bundle/Android")] //设为静态方法 static void Build1SelectedBundleAN() { //备打文件集合,当前为单个 AssetBundleBuild[] abb = new AssetBundleBuild[1]; //文件路径(当前为单个,多个文件使用数组的形式) string[] path = new string[1]; //获取文件路径(得到鼠标选中的文件); path[0] = AssetDatabase.GetAssetPath(Selection.activeObject); //备打文件路径名,从Asset/开始 abb[0].assetNames = path; //包名 abb[0].assetBundleName = "assetbundle"; //打包(“输出路径”,备打文件集合,打包设置,目标平台) BuildPipeline.BuildAssetBundles("Assets/ABs", abb, BuildAssetBundleOptions.None, BuildTarget.Android); }脚本放到Editor文件夹中。
相关文章推荐
- Unity中 BundleAsset资源的打包和解析加载
- Unity 关于AssetBundle(资源束)打包和加载(一)
- Unity资源处理机制(Assets/WWW/AssetBundle/...)读取和加载资源方式详解
- [Unity AssetBundle]Asset资源处理
- 能解开assetbundle格式资源的UnityStudio工具
- unity 生成assetbundle文件
- Unity 3D - AssetBundle ( 资源包 )
- Unity 5.3 Assetbundle热更资源
- Unity资源打包之Assetbundle
- Unity资源处理机制(Assets/WWW/AssetBundle/...)读取和加载资源方式详解
- Unity AssetBundle 热更 资源生成对应 MD5码
- Unity资源打包学习笔记(二)、如何实现高效的unity AssetBundle热更新
- Unity资源打包Assetbundle
- Unity5 AssetBundle资源管理架构设计
- Unity资源热更之AssetBundle(2)———旧版本AssetBundle
- Unity5.4 Assetbundles官方说明三(AssetBundle资源包的内部结构)
- Unity资源打包之Assetbundle
- Unity调用AssetBundle资源
- Unity AssetBundle打包与资源更新