新增DISABLE_ONDEMAND_DOWNLOAD文件配置参数
This commit is contained in:
何冠峰
2025-07-22 18:59:47 +08:00
parent 5d7afff3e4
commit 33907ea967
3 changed files with 21 additions and 1 deletions

View File

@@ -75,6 +75,11 @@ namespace YooAsset
/// </summary>
public bool AppendFileExtension { private set; get; } = false;
/// <summary>
/// 自定义参数:禁用边玩边下机制
/// </summary>
public bool DisableOnDemandDownload { private set; get; } = false;
/// <summary>
/// 自定义参数:最大并发连接数
/// </summary>
@@ -222,6 +227,10 @@ namespace YooAsset
{
AppendFileExtension = Convert.ToBoolean(value);
}
else if (name == FileSystemParametersDefine.DISABLE_ONDEMAND_DOWNLOAD)
{
DisableOnDemandDownload = Convert.ToBoolean(value);
}
else if (name == FileSystemParametersDefine.DOWNLOAD_MAX_CONCURRENCY)
{
DownloadMaxConcurrency = Convert.ToInt32(value);

View File

@@ -49,7 +49,17 @@ namespace YooAsset
}
else
{
_steps = ESteps.DownloadFile;
if (_fileSystem.DisableOnDemandDownload)
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = $"The bundle not cached : {_bundle.BundleName}";
YooLogger.Warning(Error);
}
else
{
_steps = ESteps.DownloadFile;
}
}
}

View File

@@ -11,6 +11,7 @@ namespace YooAsset
public const string APPEND_FILE_EXTENSION = "APPEND_FILE_EXTENSION";
public const string DISABLE_CATALOG_FILE = "DISABLE_CATALOG_FILE";
public const string DISABLE_UNITY_WEB_CACHE = "DISABLE_UNITY_WEB_CACHE";
public const string DISABLE_ONDEMAND_DOWNLOAD = "DISABLE_ONDEMAND_DOWNLOAD ";
public const string DOWNLOAD_MAX_CONCURRENCY = "DOWNLOAD_MAX_CONCURRENCY";
public const string DOWNLOAD_MAX_REQUEST_PER_FRAME = "DOWNLOAD_MAX_REQUEST_PER_FRAME";
public const string RESUME_DOWNLOAD_MINMUM_SIZE = "RESUME_DOWNLOAD_MINMUM_SIZE";