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
@@ -307,5 +307,36 @@ namespace YooAsset
break;
}
}
/// <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(_unpacker != null)
{
DownloadReport report = new DownloadReport();
report.Progress = _unpacker.DownloadProgress;
report.TotalSize = MainBundleInfo.Bundle.FileSize;
report.DownloadedBytes = (long)_unpacker.DownloadedBytes;
return report;
}
else
{
DownloadReport report = new DownloadReport();
report.Progress = 1f;
report.TotalSize = MainBundleInfo.Bundle.FileSize;
report.DownloadedBytes = MainBundleInfo.Bundle.FileSize;
return report;
}
}
}
}