Update PatchSystem

HostPlayMode支持WebGL平台。
This commit is contained in:
hevinci
2022-08-05 16:24:10 +08:00
parent 2ff01d10b0
commit a6fdb5691a
4 changed files with 298 additions and 155 deletions
+7 -4
View File
@@ -100,10 +100,17 @@ namespace YooAsset
/// </summary>
public bool ClearCacheWhenDirty = false;
#if UNITY_WEBGL
/// <summary>
/// WEBGL模式不支持多线程下载
/// </summary>
internal int BreakpointResumeFileSize = int.MaxValue;
#else
/// <summary>
/// 启用断点续传功能的文件大小
/// </summary>
public int BreakpointResumeFileSize = int.MaxValue;
#endif
/// <summary>
/// 下载文件校验等级
@@ -194,12 +201,8 @@ namespace YooAsset
// 初始化下载系统
if (_playMode == EPlayMode.HostPlayMode)
{
#if UNITY_WEBGL
throw new Exception($"{EPlayMode.HostPlayMode} not supports WebGL platform !");
#else
var hostPlayModeParameters = parameters as HostPlayModeParameters;
DownloadSystem.Initialize(hostPlayModeParameters.BreakpointResumeFileSize, hostPlayModeParameters.VerifyLevel);
#endif
}
// 初始化资源系统