AssetBundle依赖
【Managing asset dependencies】
一个Asset会依赖其它Asset。可以把一个Asset所依赖的Asset也打包进自己的AssetBundle。可是多个Asset可能依赖同一个/多个Asset。If a separate copy of a shared dependency is included in each bundle that has objects using it, then redundant instances of the assets will be created when the bundles are loaded. This will result in wasted memory.
To avoid such wastage, it is possible to separate shared dependencies out into a separate bundle and simply reference them from any bundles with assets that need them.
First, the referencing feature needs to be enabled with a call to BuildPipeline.PushAssetDependencies. Then, the bundle containing the referenced dependencies needs to be built.
Next, another call to PushAssetDependencies should be made before building the bundles that reference the assets from the first bundle. Additional levels of dependency can be introduced using further calls to PushAssetDependencies.
The levels of reference are stored on a stack, so it is possible to go back a level using the correspondingBuildPipeline.PopAssetDependencies function.
At runtime, you need to load a bundle containing dependencies before any other bundle that references them. For example, you would need to load a bundle of shared textures before loading a separate bundle of materials that reference those textures.
注:以上是Unity老版本特性。在老版本中,Unity需要手动添加dependency。而在新版本中,无而手管理依赖关系,PushAssetDependencies API已经被移除。
【Asset IDs】
If you anticipate needing to rebuild asset bundles that are part of a dependency chain then you should build them with theBuildAssetBundleOptions.DeterministicAssetBundle option enabled. This guarantees that the internal ID values used to identify assets will be the same each time the bundle is rebuilt.
When building the asset bundle with this method, the objects in it are assigned a 32 bit hash code that is calculated using the name of the asset bundle file, the GUID of the asset and the local id of the object in the asset. For that reason make sure to use the same file name when rebuilding. Also note that having a lot of objects might cause hash collisions preventing Unity from building the asset bundle.
AssetBundle依赖的更多相关文章
- 处理Assetbundle依赖关系时想到的一道题
在处理unit3d的assetbundle依赖关系的时候,想到了一道有趣的题目: 给定一堆数据,例如{A = {1, 3, 4}, B = {3, 4}, C = {5, 6}, D = {6, 7, ...
- 【Unity3D技术文档翻译】第1.4篇 AssetBundle 依赖关系
上一章:[Unity3D技术文档翻译]第1.3篇 创建 AssetBundles 本章原文所在章节:[Unity Manual]→[Working in Unity]→[Advanced Develo ...
- Unity5-ABSystem(四):AssetBundle依赖
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/lodypig/article/detai ...
- AssetBundle依赖关系
原地址:http://www.cnblogs.com/realtimepixels/p/3652086.html Unity AssetBundle Dependencies In the last ...
- Unity手游之路<十一>资源打包Assetbundle
http://blog.csdn.net/janeky/article/details/17652021 在手游的运营过程中,更新资源是比不可少的.资源管理第一步是资源打包.传统的打包可以将所有物件制 ...
- Unity5的AssetBundle的一点使用心得
昨天一位朋友在我这里留言,想让我写点Unity5的AssetBundle心得.于是我就看了相关的介绍,和自己确切的做了一次.下面来谈谈所谓的心得. 如果你觉得自己对AssetBundle不熟悉,建议先 ...
- Unity AssetBundles and Resources指引 (三) AssetBundle基础
本文内容主要翻译自下面这篇文章 https://unity3d.com/cn/learn/tutorials/topics/best-practices/guide-assetbundles-and- ...
- 【Unity游戏开发】AssetBundle杂记--AssetBundle的二三事
一.简介 马三在公司大部分时间做的都是游戏业务逻辑和编辑器工具等相关工作,因此对Unity AssetBundle这块的知识点并不是很熟悉,自己也是有打算想了解并熟悉一下AssetBundle,掌握一 ...
- Unity资源打包学习笔记(一)、详解AssetBundle的流程
转载请标明出处:http://www.cnblogs.com/zblade/ 本文参照unity官网上对于assetBundle的一系列讲解,主要针对assetbundle的知识点做一个梳理笔记,也为 ...
随机推荐
- JLOI2019游记
JLOI2019游记 DAY -??? 听说是12省联考,好刺激. DAY 1 看题 t1是个lydsy题我还写过博客,t2不会,t3一脸神仙. 这个t3数据好大啊,看到好几个人都用gedit打开大样 ...
- ldo的一些参数理解
psrr是衡量ldo抑制外来信号噪声的能力,而内部噪声是由基准电压和误差放大器引入的.通常器件手册说的输出噪声指的就是内部噪声. ldo的暂态响应也是一个重要指标
- webpack css loader 使用
备注: 接上面的项目 1. 添加css main.css #app { text-align:center; } main.js require("./main.css"); ...
- hashids 了解
用于隐藏真实的id 原理是从数字经过一个加盐(salted)算法产生一个哈希(hash)字符串.这样算法就是通过混淆使结果具有不可预测性,而唯一性依然由数字本身来达成,从而得到(类似 youtube ...
- 40+个对初学者非常有用的PHP技巧
1.不要使用相对路径,要定义一个根路径 这样的代码行很常见: require_once('../../lib/some_class.php'); 这种方法有很多缺点: 它首先搜索php包括路径中的指定 ...
- win10安装.net3.5 报错解决
在win10光盘里提取“microsoft-windows-netfx3-ondemand-package.cab”安装包 然后放在sxs目录 新建批处理...??Cls@ECHO OFFTITLE ...
- OPC UA (统一架构)的优势
OPC UA OPC统一架构(OPC Unified Architecture)是OPC基金会(OPC Foundation)创建的新技术,更加安全.可靠.中性(与供应商无关),为制造现场到生产计划或 ...
- linux下踢出已登录用户
通过xshell登录到linux,看到如下所示,有3个用户,但是前面两个不知在哪登录的了,那就踢出吧. 先确认一下自己是哪个 顺便注意一下“whoami”和“who am i”的不同 然后踢出前面两个 ...
- CMD中文显示为乱码
中文显示为乱码 临时解决方案: 在 CMD 中运行 chcp 936. 永久解决方案: 打开不正常的 CMD 或命令提示符窗口后,单击窗口左上角的图标,选择弹出的菜单中的“默认值”,打开如下图的对话框 ...
- 原 win10 msys2 vs2015 ffmpeg3.2.2 编译
01 环境 win10x64企业版.vs2015update3企业版.git(git version 2.10.0.windows.1). 02 下载ffmpeg代码 git clone https: ...