Update AssetSystem

pull/36/head
hevinci 2022-08-12 14:30:23 +08:00
parent 4b11238b6c
commit a422bcc858
1 changed files with 11 additions and 1 deletions

View File

@ -60,6 +60,16 @@ namespace YooAsset
return; return;
} }
if (OwnerBundle.CacheBundle == null)
{
if (OwnerBundle.IsDestroyed)
throw new System.Exception("Should never get here !");
Status = EStatus.Fail;
LastError = $"The bundle {OwnerBundle.MainBundleInfo.BundleName} has been destroyed by unity bugs !";
InvokeCompletion();
return;
}
Status = EStatus.Loading; Status = EStatus.Loading;
} }
@ -105,7 +115,7 @@ namespace YooAsset
Status = AssetObject == null ? EStatus.Fail : EStatus.Success; Status = AssetObject == null ? EStatus.Fail : EStatus.Success;
if (Status == EStatus.Fail) if (Status == EStatus.Fail)
{ {
if(MainAssetInfo.AssetType == null) if (MainAssetInfo.AssetType == null)
LastError = $"Failed to load asset : {MainAssetInfo.AssetPath} AssetType : null AssetBundle : {OwnerBundle.MainBundleInfo.BundleName}"; LastError = $"Failed to load asset : {MainAssetInfo.AssetPath} AssetType : null AssetBundle : {OwnerBundle.MainBundleInfo.BundleName}";
else else
LastError = $"Failed to load asset : {MainAssetInfo.AssetPath} AssetType : {MainAssetInfo.AssetType} AssetBundle : {OwnerBundle.MainBundleInfo.BundleName}"; LastError = $"Failed to load asset : {MainAssetInfo.AssetPath} AssetType : {MainAssetInfo.AssetType} AssetBundle : {OwnerBundle.MainBundleInfo.BundleName}";