https://docs.unity3d.com/ScriptReference/BuildPipeline.BuildAssetBundles.html



5.34升5.5打包bundle遇到问题
Assets/NEditor/TableEditor/Editor/TestTable.cs(446,17): error CS0619: `UnityEditor.BuildPipeline.BuildAssetBundle(UnityEngine.Object, UnityEngine.Object[], string, UnityEditor.BuildAssetBundleOptions)' is obsolete: `BuildAssetBundle
has been made obsolete. Please use the new AssetBundle build system introduced in 5.0 and check BuildAssetBundles documentation for details.'



BuildPipeline.BuildAssetBundles

public static AssetBundleManifest BuildAssetBundles(string outputPath, BuildAssetBundleOptions assetBundleOptions,BuildTarget targetPlatform);

Parameters

outputPath Output path for the AssetBundles.
assetBundleOptions AssetBundle building options.
targetPlatform Chosen target build platform.

Returns

AssetBundleManifest The manifest listing all AssetBundles included in this build.

Description

Build all AssetBundles specified in the editor.

Use this function to build your asset bundles, after you have marked your assets for inclusion in named AssetBundles. (See the manual page about Building
AssetBundles
 for further details). This function builds the bundles you have specified in the editor and will return the manifest that includes all of the included assets. if the build was successful and false otherwise. Additionally, error messages are
shown in the console to explain most common build failures such as incorrect target folder paths.

The outputPath is a path to a folder somewhere within the project folder where the built bundles will be saved (eg, "Assets/MyBundleFolder"). The folder will not be created automatically and the function will
simply fail if it doesn't already exist.

The optional assetBundleOptions argument modify the way the bundle is built while the targetPlatform/ selects which deployment target (Windows Standalone,
Android, iOS, etc) the bundle will be used with. Note that bundles built for standalone platforms are not compatible with those built for mobiles and so you may need to produce different versions of a given bundle. See the Asset
Bundle FAQ
 in the manual for more information about bundle compatibility among platforms.

The return value is of type AssetBundleManifest. This contains a list of all the assets included in the AssetBundle.
Null is returned if any problems occur.

// Create an AssetBundle for Windows.
using UnityEngine;
using UnityEditor; public class BuildAssetBundlesExample : MonoBehaviour
{
[MenuItem( "Example/Build Asset Bundles" )]
static void BuildABs( )
{
// Put the bundles in a folder called "ABs" within the Assets folder.
BuildPipeline.BuildAssetBundles( "Assets/ABs", BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows );
}
}

public static AssetBundleManifest BuildAssetBundles(string outputPath,
AssetBundleBuild[] builds,BuildAssetBundleOptions assetBundleOptions, BuildTarget targetPlatform);

Parameters

outputPath Output path for the AssetBundles.
builds AssetBundle building map.
assetBundleOptions AssetBundle building options.
targetPlatform Target build platform.

Returns

AssetBundleManifest The manifest listing all AssetBundles included in this build.

Description

Build AssetBundles from a building map.

This variant of the function lets you specify the names and contents of the bundles using a "build map" rather than with the details set in the editor. The map is simply an array of AssetBundleBuild objects,
each of which contains a bundle name and a list of the names of asset files to be added to the named bundle.

using UnityEngine;
using UnityEditor; public class BuildAssetBundlesBuildMapExample : MonoBehaviour
{
[MenuItem( "Example/Build Asset Bundles Using BuildMap" )]
static void BuildMapABs( )
{
// Create the array of bundle build details.
AssetBundleBuild[] buildMap = new AssetBundleBuild[2]; buildMap[0].assetBundleName = "enemybundle"; string[] enemyAssets = new string[2];
enemyAssets[0] = "Assets/Textures/char_enemy_alienShip.jpg";
enemyAssets[1] = "Assets/Textures/char_enemy_alienShip-damaged.jpg"; buildMap[0].assetNames = enemyAssets;
buildMap[1].assetBundleName = "herobundle"; string[] heroAssets = new string[1];
heroAssets[0] = "char_hero_beanMan";
buildMap[1].assetNames = heroAssets; BuildPipeline.BuildAssetBundles( "Assets/ABs", buildMap, BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows );
}
}

unity5.5打包的更多相关文章

  1. Unity5 AssetBundle 打包以及加载

    using UnityEngine; using System.Collections; using System.Collections.Generic; using UnityEditor; us ...

  2. [原]unity5 AssetBundle打包

    本文unity版本5.1.3 一.现有的打包教程: 1.http://liweizhaolili.blog.163.com/blog/static/16230744201541410275298/ 阿 ...

  3. Unity5 AssetBundle打包加载及服务器加载

    Assetbundle为资源包不是资源 打包1:通过脚本指定打包 AssetBundleBuild ab = new AssetBundleBuild                         ...

  4. Unity5.6打包问题

    将unity切换到5.6版本后打Android包时,提示android sdk tools version低于compile version,于是更新了android-sdk(下载了Android-S ...

  5. Unity5.X 新版AssetBundle打包控制

    一.什么是AssetBundle 估计很多人只知道Unity的模型之类的东西可以导出成一种叫做AssetBundle的文件,然后打包后可以在Unity程序运行的时候再加载出来用.那么AssetBund ...

  6. 再详细的介绍一下Unity5的AssetBundle

    之前曾经写了一篇博客介绍Unity5的AssetBundle,结果似乎很受关注.不过似乎很多人看了之后都不懂,主要是因为不太明白AssetBundle是什么,它的依赖关系和结构是什么的,就直接想拿代码 ...

  7. NGUI在5.3打包失败问题

    一.NGUI版本 NGUI是很好用的Unity UI插件. 当前使用版本NGUI Next-Gen UI v3.9.7 (Feb 10, 2016)和NGUI Next-Gen UI 3.9.0两个版 ...

  8. unity5 manifest

    https://www.cnblogs.com/lancidie/p/5878789.html 之前曾经写了一篇博客介绍Unity5的AssetBundle,结果似乎很受关注.不过似乎很多人看了之后都 ...

  9. 【Unity游戏开发】AssetBundle杂记--AssetBundle的二三事

    一.简介 马三在公司大部分时间做的都是游戏业务逻辑和编辑器工具等相关工作,因此对Unity AssetBundle这块的知识点并不是很熟悉,自己也是有打算想了解并熟悉一下AssetBundle,掌握一 ...

随机推荐

  1. apache 绿色版 安装

    下载绿色版apache 本文已apache2.4为例 http://www.apachehaus.com/cgi-bin/download.plx 下载后解压 打开readme_first.html文 ...

  2. 百度小程序转换微信小程序

    Python脚本,一键转换Github地址:https://github.com/DWmelon/py-transfer-BdToWx 运行条件 具备Python环境,可在命令行中使用Python命令 ...

  3. 运用<ul><li>做导航栏

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. [2018-10-10]记录一下Vue的一个问题

    最近用vue typescript SPA 做管理后台(ABP官网导出的vue项目模板),遇到一个错误,找了好久,虽然有相关资料,但发现都没解决,这里自己记录一下. Failed to mount c ...

  5. ubuntu16.04下安装wordpress

    安装过程 http://blog.topspeedsnail.com/archives/4635 http://blog.topspeedsnail.com/archives/4646 碰到的问题 1 ...

  6. html(HyperText Markup Language)--超文本标记语言

    1.html的简介? * 什么是html? ** HyperText Markup Language:超文本标记语言,网页语言 ** 超文本:超出文本的范畴,使用html可以轻松实现这样操作: ** ...

  7. java--List判断是否为空

    list.isEmpty()和list.size()==0 没有区别 isEmpty()判断有没有元素,size()返回元素个数 如果判断一个集合有无元素,用isEmpty()方法. 这就相当与,你要 ...

  8. Word怎么在方框里打勾

    插入--->符号--->其他符号--->在“子集”中选择“数学运算符”.第三行就可以找到“勾”符号,选中后点击“插入”即可. 或插入-->符号-->其他符号-->在 ...

  9. RQNOJ 202 奥运火炬登珠峰:01背包

    题目链接:https://www.rqnoj.cn/problem/202 题意: 登珠峰需要携带a(L)O2和t(L)N2. 有n个气缸可供选择.其中第i个气缸能装下a[i](L)O2和t[i](L ...

  10. listen and translation exercise 52

    Two years ago my husband bought me a bicycle. Twenty of the thirty-five years I ran my own business. ...