diff --git a/Assets/YooAsset/Runtime/DownloadSystem/DefaultDownloadRequest/UnityWebRequestAssetBundleDownloader.cs b/Assets/YooAsset/Runtime/DownloadSystem/DefaultDownloadRequest/UnityWebRequestAssetBundleDownloader.cs index feea31a9..ecfa570e 100644 --- a/Assets/YooAsset/Runtime/DownloadSystem/DefaultDownloadRequest/UnityWebRequestAssetBundleDownloader.cs +++ b/Assets/YooAsset/Runtime/DownloadSystem/DefaultDownloadRequest/UnityWebRequestAssetBundleDownloader.cs @@ -76,7 +76,7 @@ namespace YooAsset else { if (string.IsNullOrEmpty(_args.FileHash)) - throw new YooInternalException("File hash is null or empty !"); + throw new YooInternalException("File hash is null or empty!"); // 使用 Unity 缓存 // 说明:The file hash defining the version of the asset bundle. diff --git a/Assets/YooAsset/Runtime/DownloadSystem/DefaultDownloadRequest/UnityWebRequestDownloaderBase.cs b/Assets/YooAsset/Runtime/DownloadSystem/DefaultDownloadRequest/UnityWebRequestDownloaderBase.cs index 5f79567d..69f72822 100644 --- a/Assets/YooAsset/Runtime/DownloadSystem/DefaultDownloadRequest/UnityWebRequestDownloaderBase.cs +++ b/Assets/YooAsset/Runtime/DownloadSystem/DefaultDownloadRequest/UnityWebRequestDownloaderBase.cs @@ -99,7 +99,7 @@ namespace YooAsset if (_webRequest == null) { Status = EDownloadRequestStatus.Failed; - Error = $"[{GetType().Name}] Created web request is null."; + Error = $"[{GetType().Name}] Created web request is null!"; } else { @@ -109,7 +109,7 @@ namespace YooAsset catch (Exception ex) { Status = EDownloadRequestStatus.Failed; - Error = $"[{GetType().Name}] Failed to create web request : {ex.Message}"; + Error = $"[{GetType().Name}] Failed to create web request: {ex.Message}"; } } } @@ -144,7 +144,7 @@ namespace YooAsset else { Status = EDownloadRequestStatus.Failed; - Error = $"[{GetType().Name}] URL: {URL} - 错误: {_webRequest.error}"; + Error = $"[{GetType().Name}] URL: {URL} - Error: {_webRequest.error}"; OnRequestFailed(); } @@ -226,7 +226,7 @@ namespace YooAsset protected void ApplyRequestOptions(int timeout, int watchdogTime, Dictionary headers) { if (_webRequest == null) - throw new YooInternalException("Web request is null !"); + throw new YooInternalException("Web request is null!"); // 设置看门狗超时时间 _watchdogTime = watchdogTime; diff --git a/Assets/YooAsset/Runtime/DownloadSystem/DownloadSystemHelper.cs b/Assets/YooAsset/Runtime/DownloadSystem/DownloadSystemHelper.cs index 626840b6..122c96d4 100644 --- a/Assets/YooAsset/Runtime/DownloadSystem/DownloadSystemHelper.cs +++ b/Assets/YooAsset/Runtime/DownloadSystem/DownloadSystemHelper.cs @@ -57,7 +57,7 @@ namespace YooAsset #elif UNITY_STANDALONE_LINUX url = StringUtility.Format("file:///root/{0}", path); #else - throw new System.NotSupportedException($"[{nameof(DownloadSystemHelper.ConvertToWWWPath)}] not implemented platform: {UnityEngine.Application.platform}"); + throw new System.NotSupportedException($"[{nameof(DownloadSystemHelper.ConvertToWWWPath)}] Platform '{UnityEngine.Application.platform}' is not supported!"); #endif // For some special cases when users have special characters in their devices, url paths can not be identified correctly. diff --git a/Assets/YooAsset/Runtime/OperationSystem/AsyncOperationBase.cs b/Assets/YooAsset/Runtime/OperationSystem/AsyncOperationBase.cs index 513a61ef..b8f09d40 100644 --- a/Assets/YooAsset/Runtime/OperationSystem/AsyncOperationBase.cs +++ b/Assets/YooAsset/Runtime/OperationSystem/AsyncOperationBase.cs @@ -408,8 +408,6 @@ namespace YooAsset } #region 调试信息 - private const int MaxCycleCheckDepth = 4096; // 循环检测最大深度 - /// /// 开始的时间 /// @@ -466,6 +464,7 @@ namespace YooAsset /// private bool WouldCreateCycle(AsyncOperationBase child) { + const int MaxCycleCheckDepth = 4096; // 循环检测最大深度 var stack = new Stack(); var visited = new HashSet(); stack.Push(child); diff --git a/Assets/YooAsset/Runtime/ResourcePackage/AssetInfo.cs b/Assets/YooAsset/Runtime/ResourcePackage/AssetInfo.cs index 2cbae43c..468c90bf 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/AssetInfo.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/AssetInfo.cs @@ -19,17 +19,17 @@ namespace YooAsset /// /// 所属包裹 /// - public string PackageName { private set; get; } + public string PackageName { get; private set; } /// /// 资源类型 /// - public System.Type AssetType { private set; get; } + public System.Type AssetType { get; private set; } /// /// 错误信息 /// - public string Error { private set; get; } + public string Error { get; private set; } /// /// 加载方法 diff --git a/Assets/YooAsset/Runtime/ResourcePackage/Operation/ClearCacheFilesOptions.cs b/Assets/YooAsset/Runtime/ResourcePackage/Operation/ClearCacheFilesOptions.cs index 6fae85f2..e594709c 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/Operation/ClearCacheFilesOptions.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/Operation/ClearCacheFilesOptions.cs @@ -6,17 +6,17 @@ namespace YooAsset /// /// 清理模式 /// - public string ClearMode { set; get; } + public string ClearMode { get; set; } /// /// 附加参数 /// - public object ClearParam { set; get; } + public object ClearParam { get; set; } /// /// 资源清单 /// - internal PackageManifest Manifest { set; get; } + internal PackageManifest Manifest { get; set; } public ClearCacheFilesOptions(EFileClearMode clearMode) { diff --git a/Assets/YooAsset/Runtime/ResourcePackage/Operation/DownloaderOperation.cs b/Assets/YooAsset/Runtime/ResourcePackage/Operation/DownloaderOperation.cs index 6ef7d454..d3034d64 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/Operation/DownloaderOperation.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/Operation/DownloaderOperation.cs @@ -35,12 +35,12 @@ namespace YooAsset /// /// 统计的下载文件总数量 /// - public int TotalDownloadCount { private set; get; } + public int TotalDownloadCount { get; private set; } /// /// 统计的下载文件的总大小 /// - public long TotalDownloadBytes { private set; get; } + public long TotalDownloadBytes { get; private set; } /// /// 当前已经完成的下载总数量 @@ -61,29 +61,29 @@ namespace YooAsset /// /// 下载完成事件委托(无论成功或失败) /// - public DownloadFinishedEventHandler DownloadFinishedHandler { set; get; } + public DownloadFinishedEventHandler DownloadFinishedHandler { get; set; } /// /// 下载进度更新事件委托 /// - public DownloadProgressChangedEventHandler DownloadProgressChangedHandler { set; get; } + public DownloadProgressChangedEventHandler DownloadProgressChangedHandler { get; set; } /// /// 下载错误事件委托 /// - public DownloadErrorEventHandler DownloadErrorHandler { set; get; } + public DownloadErrorEventHandler DownloadErrorHandler { get; set; } /// /// 开始下载单个文件事件委托 /// - public DownloadFileStartedEventHandler DownloadFileStartedHandler { set; get; } + public DownloadFileStartedEventHandler DownloadFileStartedHandler { get; set; } internal DownloaderOperation(string packageName, List downloadList, int maximumConcurrency, int failedTryAgain) { _packageName = packageName; _bundleInfoList = downloadList; - _maximumConcurrency = UnityEngine.Mathf.Clamp(maximumConcurrency, 1, MAX_LOADER_COUNT); ; + _maximumConcurrency = UnityEngine.Mathf.Clamp(maximumConcurrency, 1, MAX_LOADER_COUNT); _failedTryAgain = failedTryAgain; // 统计下载信息 @@ -91,7 +91,7 @@ namespace YooAsset } internal override void InternalStart() { - YooLogger.Log($"Begine to download {TotalDownloadCount} files and {TotalDownloadBytes} bytes"); + YooLogger.Log($"Begin to download {TotalDownloadCount} files and {TotalDownloadBytes} bytes"); _steps = ESteps.Check; } internal override void InternalUpdate() diff --git a/Assets/YooAsset/Runtime/ResourcePackage/Operation/DownloaderOptions.cs b/Assets/YooAsset/Runtime/ResourcePackage/Operation/DownloaderOptions.cs index f479eab8..68ef2b7b 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/Operation/DownloaderOptions.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/Operation/DownloaderOptions.cs @@ -9,23 +9,23 @@ namespace YooAsset /// /// 最大并发数量 /// - public int MaximumConcurrency { set; get; } + public int MaximumConcurrency { get; set; } /// /// 失败后的重试次数 /// - public int FailedTryAgain { set; get; } + public int FailedTryAgain { get; set; } /// /// 下载资源对象所属资源包内所有资源对象依赖的资源包 /// - public bool DownloadBundleDependencies { set; get; } + public bool DownloadBundleDependencies { get; set; } /// /// 资源信息列表 /// 说明:如果列表为NULL,则下载所有资产 /// - public AssetInfo[] AssetInfos { set; get; } + public AssetInfo[] AssetInfos { get; set; } public BundleDownloaderOptions(AssetInfo assetInfo, bool downloadDependencies, int maximumConcurrency, int failedTryAgain) { @@ -51,18 +51,18 @@ namespace YooAsset /// /// 最大并发数量 /// - public int MaximumConcurrency { set; get; } + public int MaximumConcurrency { get; set; } /// /// 失败后的重试次数 /// - public int FailedTryAgain { set; get; } + public int FailedTryAgain { get; set; } /// /// 资源标签列表 /// 说明:如果列表为NULL,则下载所有资产 /// - public string[] Tags { set; get; } + public string[] Tags { get; set; } public ResourceDownloaderOptions(int maximumConcurrency, int failedTryAgain) { @@ -92,18 +92,18 @@ namespace YooAsset /// /// 最大并发数量 /// - public int MaximumConcurrency { set; get; } + public int MaximumConcurrency { get; set; } /// /// 失败后的重试次数 /// - public int FailedTryAgain { set; get; } + public int FailedTryAgain { get; set; } /// /// 资源标签列表 /// 说明:如果列表为NULL,则解压所有资产 /// - public string[] Tags { set; get; } + public string[] Tags { get; set; } public ResourceUnpackerOptions(int maximumConcurrency, int failedTryAgain) { @@ -133,17 +133,17 @@ namespace YooAsset /// /// 最大并发数量 /// - public int MaximumConcurrency { set; get; } + public int MaximumConcurrency { get; set; } /// /// 失败后的重试次数 /// - public int FailedTryAgain { set; get; } + public int FailedTryAgain { get; set; } /// /// 资源包信息列表 /// - public ImportBundleInfo[] BundleInfos { set; get; } + public ImportBundleInfo[] BundleInfos { get; set; } public BundleImporterOptions(ImportBundleInfo[] bundleInfos, int maximumConcurrency, int failedTryAgain) { diff --git a/Assets/YooAsset/Runtime/ResourcePackage/Operation/LoadPackageManifestOptions.cs b/Assets/YooAsset/Runtime/ResourcePackage/Operation/LoadPackageManifestOptions.cs index 619980b2..b2445567 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/Operation/LoadPackageManifestOptions.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/Operation/LoadPackageManifestOptions.cs @@ -6,12 +6,12 @@ namespace YooAsset /// /// 包裹版本 /// - public string PackageVersion { set; get; } + public string PackageVersion { get; set; } /// /// 超时时间 /// - public int Timeout { set; get; } + public int Timeout { get; set; } public LoadPackageManifestOptions(string packageVersion, int timeout) { diff --git a/Assets/YooAsset/Runtime/ResourcePackage/Operation/PreDownloadContentOptions.cs b/Assets/YooAsset/Runtime/ResourcePackage/Operation/PreDownloadContentOptions.cs index 08531349..69774b32 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/Operation/PreDownloadContentOptions.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/Operation/PreDownloadContentOptions.cs @@ -6,12 +6,12 @@ namespace YooAsset /// /// 预下载的包裹版本 /// - public string PackageVersion { set; get; } + public string PackageVersion { get; set; } /// /// 资源清单请求超时时间 /// - public int Timeout { set; get; } + public int Timeout { get; set; } public PreDownloadContentOptions(string packageVersion, int timeout) { diff --git a/Assets/YooAsset/Runtime/ResourcePackage/Operation/RequestPackageVersionOperation.cs b/Assets/YooAsset/Runtime/ResourcePackage/Operation/RequestPackageVersionOperation.cs index 348e1e8a..700ed3c6 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/Operation/RequestPackageVersionOperation.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/Operation/RequestPackageVersionOperation.cs @@ -18,7 +18,7 @@ namespace YooAsset /// /// 当前最新的包裹版本 /// - public string PackageVersion { private set; get; } + public string PackageVersion { get; private set; } internal RequestPackageVersionOperation(FileSystemHost host, RequestPackageVersionOptions options) diff --git a/Assets/YooAsset/Runtime/ResourcePackage/Operation/RequestPackageVersionOptions.cs b/Assets/YooAsset/Runtime/ResourcePackage/Operation/RequestPackageVersionOptions.cs index 1c0b4281..4e78ed30 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/Operation/RequestPackageVersionOptions.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/Operation/RequestPackageVersionOptions.cs @@ -6,12 +6,12 @@ namespace YooAsset /// /// 在URL末尾添加时间戳 /// - public bool AppendTimeTicks { set; get; } + public bool AppendTimeTicks { get; set; } /// /// 超时时间 /// - public int Timeout { set; get; } + public int Timeout { get; set; } public RequestPackageVersionOptions(bool appendTimeTicks, int timeout) { diff --git a/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs b/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs index 93442326..15a581e7 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs @@ -900,7 +900,7 @@ namespace YooAsset else if (InitializeStatus == EOperationStatus.Failed) { string error = _initializeOp == null ? string.Empty : _initializeOp.Error; - throw new YooPackageException(PackageName, $"Resource package initialization failed! Error : {error}"); + throw new YooPackageException(PackageName, $"Resource package initialization failed! Error: {error}"); } }