Addressable 热更新
2021-03-05 10:16:52 16 举报
AI智能生成
address
作者其他创作
大纲/内容
文件作用
Schemas
Schemas define a set of data, Groups in the inspector
Addressables_Content_State.bin
Thie file contains hash and dependency information for every Cannot Change Post Release Asset group
Catalog
Map address to each asset, specifying where and how to load it
Group
Content Update Restriction
Cannot Change Post Release
AssetBundle copy to streamingasset folder
Content marked as Cannot shiped with then app (or download sonn after install)
Addressable Asset Sytem, 也支持如果marked as Cannot 被修改,或者他的依赖被修改,Cannot Asset 会被从Cannot group中移除,然后重新放入一个新group,content_update_group, 然后放到服务器
Can ChangePost Release
DynamicContent that you except to update
Content marked as Can , resides online
Content Packing & Loading
BuildPath
LocalPaht
Tools
Check for content update restrictions
This will take any modified Asset out of the Cannot Change Post Release groups and move them to a new group
仅对Cannot Change Post Release有效
AddressableAssetSettings
Build Remote Catalog
For hot fix,要通过AA系统更新资源,则必须勾选这个选项,在构建AB包的时候才会生成对应的catalog文件,来记录AB包的hash值和地址.,本地的catalog跟服务器的Catalog对比,判断热更资源
API
Addressables.CheckForCatalogUpdates
获取更新的资源列表
Addressables.UpdateCatalogs
跟新本地的catalog与服务器一致
Disable Catelog Update On Startup
勾选
那么将不会自动更新Catalog文件,意味着不会自动更新资源。
需要自己判断资源更新
不勾选
那么每次AA系统初使化的时候会自动去更新Catalog
Checking for content updates at runtime
API
Addressables.CheckForCatalogUpdates
获取更新的资源列表
Addressables.UpdateCatalogs
跟新本地的catalog与服务器一致
Update Asset (Download Asset)
更新的assetbundle会存储到默认缓存路径(路径可配置)
PC
AppDate -> LocalLow -> Unity (默认缓存路径)
APPData -> LocalLow -> DefaultCompany (persistentDataPaht)
更新基本流程
游戏启动,调用GetDownloadSizeAsync检查获取需要更新资源的大小
调用DownloadDependenciesAsync进行下载更新
实际调用
Download—>LoadAssetAsync—>Load AB—>Load Asset—>release Asset
进入游戏,正常加载和实例化
设计定时或者特定的点进行CheckForCatalogUpdates操作
有更新情况下,提示玩家,并切换到更新界面
释放之前使用的资产
调用UpdateCatalogs更新Catalogs
重复走1、2、3的流程
收藏
0 条评论
下一页