|
@@ -87,6 +87,7 @@ namespace TModule.Runtime
|
87
|
87
|
{
|
88
|
88
|
string info = webRequest.GetResponseHeader("Content-Length");
|
89
|
89
|
_totalSzie = long.Parse(info);
|
|
90
|
+ Debug.Log($"即将下载{url},下载大小{_totalSzie}");
|
90
|
91
|
await DownloadFile();
|
91
|
92
|
}
|
92
|
93
|
}
|
|
@@ -139,9 +140,16 @@ namespace TModule.Runtime
|
139
|
140
|
onProgress?.Invoke((float)Math.Round((double)_currentDownloadSize / _totalSzie,2), _totalSzie, _currentDownloadSize);
|
140
|
141
|
if (_currentDownloadSize >= _totalSzie)
|
141
|
142
|
{
|
|
143
|
+ _currentDownloadSize = 0;
|
|
144
|
+ _totalSzie = 0;
|
|
145
|
+ DownLoadUrl = string.Empty;
|
|
146
|
+ FileSavePath = string.Empty;
|
|
147
|
+ onProgress = null;
|
|
148
|
+ onError = null;
|
|
149
|
+ onDownloadOver?.Invoke();
|
|
150
|
+ onDownloadOver = null;
|
142
|
151
|
//下载完成
|
143
|
152
|
IsLeisure = true;
|
144
|
|
- onDownloadOver?.Invoke();
|
145
|
153
|
break;
|
146
|
154
|
}
|
147
|
155
|
}
|