mirror of https://github.com/tuyoogame/YooAsset
parent
a6de89ab74
commit
f9ecad1cf0
|
@ -2,6 +2,7 @@
|
|||
using System.IO;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
|
@ -15,6 +16,12 @@ namespace YooAsset
|
|||
private static readonly Dictionary<string, DownloaderBase> _downloaderDic = new Dictionary<string, DownloaderBase>();
|
||||
private static readonly List<string> _removeList = new List<string>(100);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 自定义的证书认证实例
|
||||
/// </summary>
|
||||
public static CertificateHandler CertificateHandlerInstance;
|
||||
|
||||
/// <summary>
|
||||
/// 启用断点续传功能文件的最小字节数
|
||||
/// </summary>
|
||||
|
|
|
@ -89,6 +89,12 @@ namespace YooAsset
|
|||
_downloadHandle = handler;
|
||||
#endif
|
||||
|
||||
if (DownloadSystem.CertificateHandlerInstance != null)
|
||||
{
|
||||
_webRequest.certificateHandler = DownloadSystem.CertificateHandlerInstance;
|
||||
_webRequest.disposeCertificateHandlerOnDispose = false;
|
||||
}
|
||||
|
||||
_webRequest.downloadHandler = handler;
|
||||
_webRequest.disposeDownloadHandlerOnDispose = true;
|
||||
if (fileLength > 0)
|
||||
|
|
|
@ -162,6 +162,15 @@ namespace YooAsset
|
|||
DownloadSystem.ClearFileResponseCodes = codes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置下载系统参数,自定义的证书认证实例
|
||||
/// </summary>
|
||||
/// <param name="instance"></param>
|
||||
public static void SetDownloadSystemCertificateHandler(UnityEngine.Networking.CertificateHandler instance)
|
||||
{
|
||||
DownloadSystem.CertificateHandlerInstance = instance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置异步系统参数,每帧执行消耗的最大时间切片(单位:毫秒)
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue