pull/418/head
何冠峰 2024-12-26 14:57:37 +08:00
parent 3f8c7bd91f
commit aa3a049985
4 changed files with 26 additions and 4 deletions

View File

@ -63,6 +63,11 @@ namespace YooAsset
/// </summary> /// </summary>
public bool AppendFileExtension { private set; get; } = false; public bool AppendFileExtension { private set; get; } = false;
/// <summary>
/// 自定义参数禁用Catalog目录查询文件
/// </summary>
public bool DisableCatalogFile { private set; get; } = false;
/// <summary> /// <summary>
/// 自定义参数:解密方法类 /// 自定义参数:解密方法类
/// </summary> /// </summary>
@ -138,6 +143,10 @@ namespace YooAsset
{ {
AppendFileExtension = (bool)value; AppendFileExtension = (bool)value;
} }
else if (name == FileSystemParametersDefine.DISABLE_CATALOG_FILE)
{
DisableCatalogFile = (bool)value;
}
else if (name == FileSystemParametersDefine.DECRYPTION_SERVICES) else if (name == FileSystemParametersDefine.DECRYPTION_SERVICES)
{ {
DecryptionServices = (IDecryptionServices)value; DecryptionServices = (IDecryptionServices)value;
@ -172,10 +181,14 @@ namespace YooAsset
public virtual bool Belong(PackageBundle bundle) public virtual bool Belong(PackageBundle bundle)
{ {
if (DisableCatalogFile)
return true;
return _wrappers.ContainsKey(bundle.BundleGUID); return _wrappers.ContainsKey(bundle.BundleGUID);
} }
public virtual bool Exists(PackageBundle bundle) public virtual bool Exists(PackageBundle bundle)
{ {
if (DisableCatalogFile)
return true;
return _wrappers.ContainsKey(bundle.BundleGUID); return _wrappers.ContainsKey(bundle.BundleGUID);
} }
public virtual bool NeedDownload(PackageBundle bundle) public virtual bool NeedDownload(PackageBundle bundle)
@ -304,9 +317,9 @@ namespace YooAsset
} }
/// <summary> /// <summary>
/// 记录文件信息 /// 记录内置文件信息
/// </summary> /// </summary>
public bool RecordFile(string bundleGUID, FileWrapper wrapper) public bool RecordBuildinFile(string bundleGUID, FileWrapper wrapper)
{ {
if (_wrappers.ContainsKey(bundleGUID)) if (_wrappers.ContainsKey(bundleGUID))
{ {

View File

@ -48,7 +48,15 @@ namespace YooAsset
if (_initUnpackFIleSystemOp.Status == EOperationStatus.Succeed) if (_initUnpackFIleSystemOp.Status == EOperationStatus.Succeed)
{ {
_steps = ESteps.LoadCatalogFile; if (_fileSystem.DisableCatalogFile)
{
_steps = ESteps.Done;
Status = EOperationStatus.Succeed;
}
else
{
_steps = ESteps.LoadCatalogFile;
}
} }
else else
{ {

View File

@ -51,7 +51,7 @@ namespace YooAsset
foreach (var wrapper in catalog.Wrappers) foreach (var wrapper in catalog.Wrappers)
{ {
var fileWrapper = new DefaultBuildinFileSystem.FileWrapper(wrapper.FileName); var fileWrapper = new DefaultBuildinFileSystem.FileWrapper(wrapper.FileName);
_fileSystem.RecordFile(wrapper.BundleGUID, fileWrapper); _fileSystem.RecordBuildinFile(wrapper.BundleGUID, fileWrapper);
} }
YooLogger.Log($"Package '{_fileSystem.PackageName}' buildin catalog files count : {catalog.Wrappers.Count}"); YooLogger.Log($"Package '{_fileSystem.PackageName}' buildin catalog files count : {catalog.Wrappers.Count}");

View File

@ -7,6 +7,7 @@ namespace YooAsset
public const string REMOTE_SERVICES = "REMOTE_SERVICES"; public const string REMOTE_SERVICES = "REMOTE_SERVICES";
public const string DECRYPTION_SERVICES = "DECRYPTION_SERVICES"; public const string DECRYPTION_SERVICES = "DECRYPTION_SERVICES";
public const string APPEND_FILE_EXTENSION = "APPEND_FILE_EXTENSION"; 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_UNITY_WEB_CACHE = "DISABLE_UNITY_WEB_CACHE";
public const string DOWNLOAD_MAX_CONCURRENCY = "DOWNLOAD_MAX_CONCURRENCY"; 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 DOWNLOAD_MAX_REQUEST_PER_FRAME = "DOWNLOAD_MAX_REQUEST_PER_FRAME";