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,8 +1,6 @@
using Cysharp.Threading.Tasks;
using System.Collections.Generic;
using UnityEngine;
using YooAsset;
using static UnityEngine.Rendering.VirtualTexturing.Debugging;
public class Boot : MonoBehaviour
{

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} 资源下载中...");

View File

@@ -1,5 +1,4 @@
using System;
using UnityEngine;
public static class PatchEvent
{

View File

@@ -1,4 +1,3 @@
using UnityEngine;
using Cysharp.Threading.Tasks;
using YooAsset;
public class PatchManager : Singleton<PatchManager>

View File

@@ -1,6 +1,4 @@
using Cysharp.Threading.Tasks;
using System;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;
using YooAsset;

View File

@@ -1,4 +1,3 @@
using UnityEngine;
public class Singleton<T> where T:class,new()