|
@@ -79,12 +79,12 @@ public class AssetDownloader : SingletonMono<AssetDownloader>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- private IEnumerator DownloadFile(string url, Action<UnityWebRequest> callback)
|
|
|
|
|
|
|
+ private IEnumerator DownloadFile(string url, Action<UnityWebRequest> callback, int _timeout = 5)
|
|
|
{
|
|
{
|
|
|
Debug.Log($"url = {url}");
|
|
Debug.Log($"url = {url}");
|
|
|
UnityWebRequest webRqst = UnityWebRequest.Get(url);
|
|
UnityWebRequest webRqst = UnityWebRequest.Get(url);
|
|
|
float timeOut = Time.time;
|
|
float timeOut = Time.time;
|
|
|
- webRqst.timeout = 20;
|
|
|
|
|
|
|
+ webRqst.timeout = _timeout;
|
|
|
UnityWebRequestAsyncOperation asyncOperation = webRqst.SendWebRequest();
|
|
UnityWebRequestAsyncOperation asyncOperation = webRqst.SendWebRequest();
|
|
|
float progress = 0;
|
|
float progress = 0;
|
|
|
|
|
|
|
@@ -291,9 +291,9 @@ public class AssetDownloader : SingletonMono<AssetDownloader>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- public void DownLoadFileByCoroutine(string url, Action<UnityWebRequest> callback)
|
|
|
|
|
|
|
+ public void DownLoadFileByCoroutine(string url, Action<UnityWebRequest> callback,int timeout = 5)
|
|
|
{
|
|
{
|
|
|
- StartCoroutine(DownloadFile(url, callback));
|
|
|
|
|
|
|
+ StartCoroutine(DownloadFile(url, callback,5));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void AssetLoadToLocalByCorutine(string url, string toPath, Action<byte[]> callback = null)
|
|
public void AssetLoadToLocalByCorutine(string url, string toPath, Action<byte[]> callback = null)
|