Unity Addressables 内容更新

问题描述 投票:0回答:0

我正在尝试更新资产,但首次启动后的下载大小始终保持为零。在第一次启动下载大小得到正确的大小。并在清除 indexedDB 后显示正确。平台是webgl。我如何检查更新后的资产大小?

private IEnumerator PreLoadData()
{
    AsyncOperationHandle<long> downloadSizeHandler = Addressables.GetDownloadSizeAsync(PreloadLabel);
    yield return downloadSizeHandler;

    OnSizeRecived.Invoke(downloadSizeHandler.Result);

    if (downloadSizeHandler.Result > 0)
    {
        AsyncOperationHandle downloadDependencies = Addressables.DownloadDependenciesAsync(PreloadLabel);

        while (!downloadDependencies.IsDone)
        {
            OnPercentChange.Invoke(downloadDependencies.PercentComplete);
            yield return null;
        }
    }

    OnDownloadCompleated.Invoke();
}
unity3d assets addressables
© www.soinside.com 2019 - 2024. All rights reserved.