Преглед на файлове

修改断点续传Bug (#204)

断点续传中使用到了项目的一个扩展方法,但并未上传;去掉了扩展方法的调用
肖红 преди 5 години
родител
ревизия
cb95094809

+ 2 - 4
Unity/Assets/Model/Module/UnityWebRequest/UnityWebRequestRenewalAsync.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.IO;
+using UnityEngine;
 using UnityEngine.Networking;
 
 namespace ET
@@ -224,6 +225,7 @@ namespace ET
                 this.headRequest.SendWebRequest();
                 await this.tcs.Task;
                 this.totalBytes = long.Parse(this.headRequest.GetResponseHeader("Content-Length"));
+                string modifiedTime = this.headRequest.GetResponseHeader("Last-Modified");
                 Log.Debug($"totalBytes: {this.totalBytes}");
                 this.headRequest?.Dispose();
                 this.headRequest = null;
@@ -231,10 +233,6 @@ namespace ET
                 #endregion
 
                 #region Check Local File
-
-                var dirPath = Path.GetDirectoryName(filePath);
-                //如果路径不存在就创建
-                dirPath.CreateDirectory();
                 //打开或创建
                 fileStream = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.Write);
                 //获取已下载长度

+ 11 - 0
Unity/Assets/Model/Module/UnityWebRequest/UnityWebRequestRenewalAsync.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4f133dd2fbe0e43c2b878d3e865464ba
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: