From 86142ed4dbdc5a2429654e8dd2a6b915941b45eb Mon Sep 17 00:00:00 2001 From: hevinci Date: Wed, 20 Jul 2022 10:57:40 +0800 Subject: [PATCH] Fixed #25 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了资源文件不存在返回的handle无法完成的问题。 --- Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs | 6 +++--- .../Runtime/AssetSystem/Provider/CompletedProvider.cs | 6 +++--- .../YooAsset/Runtime/AssetSystem/Provider/ProviderBase.cs | 1 - 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs b/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs index d756027..c1c1256 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs @@ -139,8 +139,8 @@ namespace YooAsset { if (assetInfo.IsInvalid) { - YooLogger.Warning(assetInfo.Error); CompletedProvider completedProvider = new CompletedProvider(assetInfo); + completedProvider.SetCompleted(); return completedProvider.CreateHandle(); } @@ -178,8 +178,8 @@ namespace YooAsset { if (assetInfo.IsInvalid) { - YooLogger.Warning(assetInfo.Error); CompletedProvider completedProvider = new CompletedProvider(assetInfo); + completedProvider.SetCompleted(); return completedProvider.CreateHandle(); } @@ -203,8 +203,8 @@ namespace YooAsset { if (assetInfo.IsInvalid) { - YooLogger.Warning(assetInfo.Error); CompletedProvider completedProvider = new CompletedProvider(assetInfo); + completedProvider.SetCompleted(); return completedProvider.CreateHandle(); } diff --git a/Assets/YooAsset/Runtime/AssetSystem/Provider/CompletedProvider.cs b/Assets/YooAsset/Runtime/AssetSystem/Provider/CompletedProvider.cs index bf58be7..3b487a2 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Provider/CompletedProvider.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Provider/CompletedProvider.cs @@ -19,9 +19,9 @@ namespace YooAsset } public override void Update() { - if (IsDone) - return; - + } + public void SetCompleted() + { if (Status == EStatus.None) { Status = EStatus.Fail; diff --git a/Assets/YooAsset/Runtime/AssetSystem/Provider/ProviderBase.cs b/Assets/YooAsset/Runtime/AssetSystem/Provider/ProviderBase.cs index 887ebf6..ae51528 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Provider/ProviderBase.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Provider/ProviderBase.cs @@ -128,7 +128,6 @@ namespace YooAsset /// /// 创建操作句柄 /// - /// public T CreateHandle() where T : OperationHandleBase { // 引用计数增加