This commit is contained in:
2025-11-05 20:56:21 +08:00
parent c5c380d170
commit 5b31b629cd
10 changed files with 15 additions and 83 deletions

View File

@@ -1,6 +1,4 @@
using Cysharp.Threading.Tasks;
using System;
using UnityEngine;
using YooAsset;
public class MainOperation
@@ -48,7 +46,7 @@ public class MainOperation
private void OnDownloadUpdate(DownloadUpdateData downloadUpdateData)
{
float progress = (float)downloadUpdateData.CurrentDownloadBytes / downloadUpdateData.TotalDownloadBytes;
string sizeText = $"{(downloadUpdateData.CurrentDownloadBytes / 1024f / 1024f):F1}MB / {(downloadUpdateData.TotalDownloadBytes / 1024f / 1024f):F1}MB";
string sizeText = $"{operation.FormatFileSize(downloadUpdateData.CurrentDownloadBytes)} / {operation.FormatFileSize(downloadUpdateData.TotalDownloadBytes)}";
PatchEvent.UpdateProgress(progress);
PatchEvent.UpdateDownloadSize(sizeText);
PatchEvent.UpdateStatus($"{data.packageName} 资源下载中...");