update operation logic

This commit is contained in:
何冠峰
2024-07-07 16:01:55 +08:00
parent 25231ecd32
commit 260867b588
46 changed files with 525 additions and 678 deletions
@@ -4,7 +4,7 @@ using UnityEngine;
namespace YooAsset
{
internal sealed class DatabaseAllAssetsProvider : ProviderBase
internal sealed class DatabaseAllAssetsProvider : ProviderOperation
{
public DatabaseAllAssetsProvider(ResourceManager manager, string providerGUID, AssetInfo assetInfo) : base(manager, providerGUID, assetInfo)
{
@@ -41,16 +41,12 @@ namespace YooAsset
// 1. 检测资源包
if (_steps == ESteps.CheckBundle)
{
if (IsWaitForAsyncComplete)
FileLoader.WaitForAsyncComplete();
if (FileLoader.IsDone() == false)
if (LoadBundleFileOp.IsDone == false)
return;
if (FileLoader.Status != BundleFileLoader.EStatus.Succeed)
if (LoadBundleFileOp.Status != EOperationStatus.Succeed)
{
string error = FileLoader.LastError;
InvokeCompletion(error, EOperationStatus.Failed);
InvokeCompletion(LoadBundleFileOp.Error, EOperationStatus.Failed);
return;
}
@@ -63,7 +59,7 @@ namespace YooAsset
if (MainAssetInfo.AssetType == null)
{
List<UnityEngine.Object> result = new List<Object>();
foreach (var assetPath in FileLoader.MainBundleInfo.IncludeAssetsInEditor)
foreach (var assetPath in LoadBundleFileOp.BundleFileInfo.IncludeAssetsInEditor)
{
UnityEngine.Object mainAsset = UnityEditor.AssetDatabase.LoadMainAssetAtPath(assetPath);
if (mainAsset != null)
@@ -74,7 +70,7 @@ namespace YooAsset
else
{
List<UnityEngine.Object> result = new List<Object>();
foreach (var assetPath in FileLoader.MainBundleInfo.IncludeAssetsInEditor)
foreach (var assetPath in LoadBundleFileOp.BundleFileInfo.IncludeAssetsInEditor)
{
UnityEngine.Object mainAsset = UnityEditor.AssetDatabase.LoadAssetAtPath(assetPath, MainAssetInfo.AssetType);
if (mainAsset != null)