ybx_Gdn 10 сар өмнө
parent
commit
c445056cc5

+ 2 - 2
Assets/Src/Core/DownLoad/AssetDownloader.cs

@@ -83,7 +83,7 @@ public class AssetDownloader : SingletonMono<AssetDownloader>
         Debug.Log($"url = {url}");
         UnityWebRequest webRqst = UnityWebRequest.Get(url);
         float timeOut = Time.time;
-        webRqst.timeout = 5;
+        webRqst.timeout = 20;
         UnityWebRequestAsyncOperation asyncOperation = webRqst.SendWebRequest();
         float progress = 0;
        
@@ -106,7 +106,7 @@ public class AssetDownloader : SingletonMono<AssetDownloader>
         progress = webRqst.downloadProgress;
         //yield return asyncOperation;
 
-        if (webRqst != null && webRqst.error == null)
+        if (webRqst != null && webRqst.result ==  UnityWebRequest.Result.Success)
         {
             Debug.Log($"[{url}] 下载完成");
             callback?.Invoke(webRqst);

+ 2 - 2
Assets/Src/Core/DownLoad/DownloadTask.cs

@@ -73,7 +73,7 @@ public class DownloadTask : MonoBehaviour
         {
             ret = false;
         }
-        webRqst.timeout = 5;
+        webRqst.timeout = 20;
         return ret;
     }
 
@@ -124,7 +124,7 @@ public class DownloadTask : MonoBehaviour
         CurDownloadEntity.UpDateCallback?.Invoke(this);
      
 
-        if (webRqst != null && webRqst.error == null)
+        if (webRqst != null && webRqst.result ==  UnityWebRequest.Result.Success)
         {
             Debug.Log($"[{CurDownloadEntity.FullName}] 下载完成");
             State = DownloadTaskState.DownloadSuccess;