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. postgres 备份数据库

    https://www.postgresql.org/docs/9.1/static/app-pgdump.html bash-4.2$ pg_dump -Fc xianlan_prod > / ...

  2. Thinkphp2.2 config.inc.php常用配置

    CHECK_FILE_CASE -- windows环境下面的严格检查大小写. /* 项目设定 */    'APP_DEBUG'    => false, // 是否开启调试模式    'AP ...

  3. PAT 乙级 1085. PAT单位排行 (25) 【结构体排序】

    题目链接 https://www.patest.cn/contests/pat-b-practise/1085 思路 结构体排序 要注意几个点 它的加权总分 是 取其整数部分 也就是 要 向下取整 然 ...

  4. hashMap的线程不安全

    hashMap是非线程安全的,表现在两种情况下: 1 扩容: t1线程对map进行扩容,此时t2线程来读取数据,原本要读取位置为2的元素,扩容后此元素位置未必是2,则出现读取错误数据. 2 hash碰 ...

  5. IDA调试android so的.init_array数组

    参考: http://www.itdadao.com/articles/c15a190757p0.html 一. 为什么要调试init_array init_array的用途 1. 一些全局变量的初始 ...

  6. BZOJ 2819 Nim 树链剖分+树状数组

    这题真没什么意思. 不过就是将普通的求Min,Max,求和等东西换成Xor,偏偏Xor还有很多性质. 算是刷道水题吧. #include<iostream> #include<cst ...

  7. python循环次数的使用

    a=[str(i) for i in range(88888,88912)] b=[str(i) for i in range(77777,77785)] def f(a,b,k=0,m=0): n= ...

  8. BZOJ 1660 [Usaco2006 Nov]Bad Hair Day 乱发节:单调栈

    题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1660 题意: 有n头牛,身高分别为h[i]. 它们排成一排,面向右边.第i头牛可以看见在它 ...

  9. window/body/img/iframe 的onload事件

    在html页面中,只有body,img,iframe这一类标签具有onload事件. onload事件表示在当前元素载入完成后发生的事件.其中,window也有onload事件,但是跟body的是同一 ...

  10. riverbed 流量分析——还是在基于流量做运维

    from:https://www.riverbed.com/sg/digital-performance/index.htmlMaximise Your Digital PerformanceConn ...