update asset sytem

资源句柄类增加GetDownloadReport()方法。
This commit is contained in:
hevinci
2022-12-05 14:36:26 +08:00
parent 5197d42807
commit ac88fd5cf6
20 changed files with 252 additions and 143 deletions
@@ -226,5 +226,36 @@ namespace YooAsset
YooLogger.Error($"WebGL platform not support {nameof(WaitForAsyncComplete)} ! Use the async load method instead of the sync load method !");
}
}
/// <summary>
/// 获取下载报告
/// </summary>
public override DownloadReport GetDownloadReport()
{
if (_downloader != null)
{
DownloadReport report = new DownloadReport();
report.Progress = _downloader.DownloadProgress;
report.TotalSize = MainBundleInfo.Bundle.FileSize;
report.DownloadedBytes = (long)_downloader.DownloadedBytes;
return report;
}
else if (_webRequest != null)
{
DownloadReport report = new DownloadReport();
report.Progress = _webRequest.downloadProgress;
report.TotalSize = MainBundleInfo.Bundle.FileSize;
report.DownloadedBytes = (long)_webRequest.downloadedBytes;
return report;
}
else
{
DownloadReport report = new DownloadReport();
report.Progress = 1f;
report.TotalSize = MainBundleInfo.Bundle.FileSize;
report.DownloadedBytes = MainBundleInfo.Bundle.FileSize;
return report;
}
}
}
}