testads1

2016年3月21日星期一

制造assetBundle文件

制造assetBundle文件的方法是BuildPipeline.BuildAssetBundle
可以写在任何脚本中,随时可以执行这个,具体参数意义可以看下帮助手册
下面附件提供一个国外论坛的家伙写的一个小帮助脚本,非常简单,以后我们也可以用这种方式开发“插件”

说下使用方法:
1、把附件脚本放到工程文件夹下的...\Assets\Editor文件夹下。
2、在工程的Project视图里点击想要保存的资源,网络上推荐的是Prefab,右键点击,选择菜单里最下面的两个选项任意一个都可以,第一个选项对应的自定义属性有一个过期了,但是不影响使用。
3、指定文件的构建路径和文件后缀,后缀无所谓。
4、推荐制造做法:
任何形式的资源都可以,包括集合资源,比如创建一个空的GameObject,把所有想要关联的其他GameObject都拖进去,然后在project视图里创建一个prefab,将这个集合资源GameObject拖进去作为一个prefab。执行上面的第2、3步骤。

下面是原文:
First of all, you have to have the \Assets\Editor\ExportResource.js file also \Assets\Editor\AutomatedExportResources.js, then you create the graphic components and save them into a prefab.
then you select that prefab on the project section and go to Asset->Build AssetBundle From Selection... there you choose the output path and thats all.
you will have a valid .unity3d asset bundle.

没有评论:

发表评论