Update AssetSystem

This commit is contained in:
hevinci
2022-03-23 12:44:56 +08:00
parent 3e8b8123e1
commit 829b4fca76
17 changed files with 265 additions and 129 deletions
@@ -62,9 +62,9 @@ namespace YooAsset
if (IsWaitForAsyncComplete)
{
if (AssetType == null)
AllAssets = OwnerBundle.CacheBundle.LoadAssetWithSubAssets(AssetName);
AllAssetObjects = OwnerBundle.CacheBundle.LoadAssetWithSubAssets(AssetName);
else
AllAssets = OwnerBundle.CacheBundle.LoadAssetWithSubAssets(AssetName, AssetType);
AllAssetObjects = OwnerBundle.CacheBundle.LoadAssetWithSubAssets(AssetName, AssetType);
}
else
{
@@ -85,17 +85,17 @@ namespace YooAsset
{
// 强制挂起主线程(注意:该操作会很耗时)
YooLogger.Warning("Suspend the main thread to load unity asset.");
AllAssets = _cacheRequest.allAssets;
AllAssetObjects = _cacheRequest.allAssets;
}
else
{
if (_cacheRequest.isDone == false)
return;
AllAssets = _cacheRequest.allAssets;
AllAssetObjects = _cacheRequest.allAssets;
}
}
Status = AllAssets == null ? EStatus.Fail : EStatus.Success;
Status = AllAssetObjects == null ? EStatus.Fail : EStatus.Success;
if (Status == EStatus.Fail)
YooLogger.Warning($"Failed to load sub assets : {AssetName} from bundle : {OwnerBundle.BundleFileInfo.BundleName}");
InvokeCompletion();