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的知识点做一个梳理笔记,也为 ...
随机推荐
- bat总结1
获取当前目录 @echo offecho 当前盘符:%~d0echo 当前盘符和路径:%~dp0echo 当前盘符和路径的短文件名格式:%~sdp0echo 当前批处理全路径:%~f0echo 当前C ...
- java创建多线程&创建进程
概述 并发和并行是即相似又有区别: 并行:指两个或多个事件在同一时刻发生: 并发:指两个或多个事件在同一时间段内发生. 进程是指一个内存中运行中的应用程序.每个进程都有自己独立的一块内存空间,一个应用 ...
- Jitsi 开源视频会议远程桌面共享&&文档共享工具
1. 特点 主要功能特点: 支持网络视频会议,使用SFU模式实现视频路由器功能. 支持SIP帐号注册电话呼叫. 支持安卓苹果终端. 支持文档共享功能,即时消息功能. 支持中文界面. 支持会议邀请,密码 ...
- 常用ETL工具
一 ETL工具[国外] 1. datastage点评:最专业的ETL工具,价格不菲,使用难度一般 下载地址:ftp://ftp.seu.edu.cn/Pub/Develop ... taStage.v ...
- ecmall页面空白解决方案(转)
页面空白解决方案: ------------------------------------------------------------------------------------------ ...
- webservice-之使用axis+spring开发
一.环境配置 :在 eclipse 中配置引入相应的 spring框架( core/Remoting/Web ). axis 包. 二.代码开发 1. 在 MyEclipse 中建立一个新的 J ...
- angular-ui-bootstrap弹出框的使用(一)
在开发项目时,我们经常性的会遇到弹出框的需求,例如登陆,注册,添加信息等等....面对这一需求,我们当然也可以使用自己的双手进行编写,如果你时间充足可以试试. 今天我们讲解一下如何在angular框架 ...
- linux(centos)下安装ffmpeg
[备忘]windows环境下20行php代码搞定音频裁剪 上次我的这篇文章将了windows下web中如何操作ffmpeg的文章,这里则记录下linux(centos)下的安装 首先:我花了中午大概1 ...
- MOSS 2013研究系列---隐藏Ribbon
我们在开发Sharepoint 2013 的时候,常常需要隐藏Ribbon,那个Ribbon是属于Office的特征,但是我们做门户的时候,大家都不希望看见到它,但是我们又离不开它,以管理的身份进行设 ...
- 基于Spring Boot和Spring Cloud实现微服务架构
官网的技术导读真的描述的很详细,虽然对于我们看英文很费劲,但如果英文不是很差,请选择沉下心去读,你一定能收获好多.我的学习是先从Spring boot开始的,然后接触到微服务架构,当然,这一切最大的启 ...