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