diff --git a/Assets/TEngine/Runtime/GameFramework/Resource/YooAsset/PackageSystem/Operations/DownloaderOperation.cs b/Assets/TEngine/Runtime/GameFramework/Resource/YooAsset/PackageSystem/Operations/DownloaderOperation.cs index 352c6176..6b6d8483 100644 --- a/Assets/TEngine/Runtime/GameFramework/Resource/YooAsset/PackageSystem/Operations/DownloaderOperation.cs +++ b/Assets/TEngine/Runtime/GameFramework/Resource/YooAsset/PackageSystem/Operations/DownloaderOperation.cs @@ -34,6 +34,7 @@ namespace YooAsset private int _lastDownloadCount = 0; private long _cachedDownloadBytes = 0; private int _cachedDownloadCount = 0; + private float _currentSpeed = 0f; private ESteps _steps = ESteps.None; @@ -62,6 +63,14 @@ namespace YooAsset { get { return _lastDownloadBytes; } } + + /// + /// 当前下载器下载速度 + /// + public float CurrentSpeed + { + get { return _currentSpeed; } + } /// /// 当下载器结束(无论成功或失败) @@ -150,6 +159,7 @@ namespace YooAsset _cachedDownloadCount++; _cachedDownloadBytes += bundleInfo.Bundle.FileSize; } + _currentSpeed = downloadBytes / UnityEngine.Time.time; // 移除已经完成的下载器(无论成功或失败) foreach (var loader in _removeList)