From d4fcb868d8ccf2eb773aa8bd59b0a7bc59b41566 Mon Sep 17 00:00:00 2001 From: hevinci Date: Wed, 22 Nov 2023 11:13:39 +0800 Subject: [PATCH] update resource package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复下载器合并后重新计算下载字节数不正确的问题。 --- .../ResourcePackage/Operation/DownloaderOperation.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Assets/YooAsset/Runtime/ResourcePackage/Operation/DownloaderOperation.cs b/Assets/YooAsset/Runtime/ResourcePackage/Operation/DownloaderOperation.cs index 6f8909a..8aea98b 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/Operation/DownloaderOperation.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/Operation/DownloaderOperation.cs @@ -208,12 +208,18 @@ namespace YooAsset { if (_bundleInfoList != null) { + TotalDownloadBytes = 0; TotalDownloadCount = _bundleInfoList.Count; foreach (var packageBundle in _bundleInfoList) { TotalDownloadBytes += packageBundle.Bundle.FileSize; } } + else + { + TotalDownloadBytes = 0; + TotalDownloadCount = 0; + } } /// @@ -255,7 +261,7 @@ namespace YooAsset // 重新统计下载信息 CalculatDownloaderInfo(); } - + /// /// 开始下载 ///