Addressables+CCD云端分发服务
1.账号登陆
使用Unity账号登陆CCD云服务控制台
CCD操作文档
CCD资源云加载服务后台对应腾讯云,需要进行腾讯账号绑定
点击Cloud Content Delivery,选择组织机构,点击开通即可
点击Overvie,选择需要云端分发的项目并进入
依次点击Content Delivery——COS Key,记下右侧的COS key号码,后面要使用
打开Unity工程,打开Package Manager窗口并搜索Addressables和Cloud Content Delivery插件导入
5.Cloud Content Delivery插件使用在Windo菜单下打开Cloud Content Delivery插件界面
根据提示,前往ProjectSettings界面CloudContentDelivery项填写COS Key。
在bucket name输入bucket名称,点击Create Ne Bucket即可新建bucket。
点击List Bucket,刷新bucket列表,点击bucket下拉列表选择要上传到的bucket,
点击Set Release Url以设置当前的Addressable的远程加载地址为当前bucket地址(勾选latest则始终获取该bucket下最新的release)
打开Addressable打包界面
点击选择需要远程加载的资源包,设置资源的Labels标签,在右侧设置打包和加载地址分别为RemoteBuildPath和RemoteLoadPath
依次点击Build——Ne Build——Default Build Script,打包资源完成后反回CloudContentDelivery界面,点击SyncEntries,上传完成后可点击List Entries刷新资源查看。点击CreateRelease创建发布
至此,打包发布游戏即可。
资源更新当资源变更需要远程更新时,选择build下的update previousbuild打包新的bundle。打开CCD插件面板,点击SyncEntries,点击CreateRelease即可
注意在配合addressable使用release的promote功能时,务必使两个bucket对应的addressable的
Settings(Windo >> Asset Managment >> Addressables >> Settings)中Catlog选项下的Player
Version Override的值保持一致且不为空!
预加载示例代码
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.AddressableAssets.ResourceLocators; using UnityEngine.UI; using System; public class TextureController : MonoBehaviour { public Renderer m_ReferencedMaterial; public Slider progressBar; public Text progressText; AsyncOperationHandle donloadDependencies; public void PreloadTex() { StartCoroutine(StartPreload()); } public IEnumerator StartPreload() { AsyncOperationHandlehandle = Addressables.InitializeAsync(); yield return handle; Debug.Log("InitializeAsync"); //Clear all cached AssetBundles Caching.ClearCache(); string key = "HD"; AsyncOperationHandle getDonloadSize = Addressables.GetDonloadSizeAsync(key); yield return getDonloadSize; if (getDonloadSize.Result > 0) { donloadDependencies = Addressables.DonloadDependenciesAsync(key); progressBar.gameObject.SetActive(true); yield return donloadDependencies; } } private void Update() { if (donloadDependencies.IsValid()) { if (donloadDependencies.GetDonloadStatus().Percent < 1) { UpdateProgressBar(donloadDependencies.GetDonloadStatus().Percent); } else if (donloadDependencies.IsDone) { Addressables.Release(donloadDependencies); } } } void UpdateProgressBar(float donloadPercent) { progressBar.value = donloadPercent; progressText.text = Mathf.CeilToInt(donloadPercent 100f) + "%"; } public void SitchToHighDef() { LoadTexture("TEX_Archer_D", "HD"); } void LoadTexture(string key, string label) { //Caching.ClearCache(); Addressables .LoadAssetsAsync (ne List
家电修理
- 织葫芦岛县热水器维修;湖州织里热水器维修
- 扬州宁德热水器维修电话(宁德热水器维修指南
- 诸城热水器故障码F3-诸城热水器故障码E4
- 宜春市区常德顿(BESIDON)壁挂炉服务24小时热线-厂
- 笋岗维修燃气灶(维修燃气灶的电话号码)
- 佳木斯瑞特太阳能热水器维修(维护保养的具体
- 昆明中央空调维修客服在线报修中心
- 郑州惠济区热水器维修(专业维修服务解决您的
- 徐州阳春燃气灶厂家服务热线
- 湘西热水器故障码E3-热水器代码E3是什么意思
- 邢台商用热水器维修电话
- 康泉煤气灶售后维修-全国统一网点客户服务中心
- 街道热水器维修流程表(城区热水器维修实惠)
- 铜川中央空调全国服务电话网点-铜川中央空调官
- 深圳营口热水器维修(解决热水器故障的方法)
- 如何计算电线平方数。电工知识