parent
885c35bf9d
commit
bc38159bed
|
@ -53,6 +53,12 @@ namespace YooAsset
|
|||
return;
|
||||
}
|
||||
|
||||
if (OwnerBundle.CacheBundle == null)
|
||||
{
|
||||
ProcessCacheBundleException();
|
||||
return;
|
||||
}
|
||||
|
||||
Status = EStatus.Loading;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,12 +55,7 @@ namespace YooAsset
|
|||
|
||||
if (OwnerBundle.CacheBundle == null)
|
||||
{
|
||||
if (OwnerBundle.IsDestroyed)
|
||||
throw new System.Exception("Should never get here !");
|
||||
Status = EStatus.Failed;
|
||||
LastError = $"The bundle {OwnerBundle.MainBundleInfo.Bundle.BundleName} has been destroyed by unity bugs !";
|
||||
YooLogger.Error(LastError);
|
||||
InvokeCompletion();
|
||||
ProcessCacheBundleException();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,6 +53,12 @@ namespace YooAsset
|
|||
return;
|
||||
}
|
||||
|
||||
if (OwnerBundle.CacheBundle == null)
|
||||
{
|
||||
ProcessCacheBundleException();
|
||||
return;
|
||||
}
|
||||
|
||||
Status = EStatus.Loading;
|
||||
}
|
||||
|
||||
|
|
|
@ -220,6 +220,30 @@ namespace YooAsset
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理特殊异常
|
||||
/// </summary>
|
||||
protected void ProcessCacheBundleException()
|
||||
{
|
||||
if (OwnerBundle.IsDestroyed)
|
||||
throw new System.Exception("Should never get here !");
|
||||
|
||||
if (OwnerBundle.MainBundleInfo.Bundle.IsRawFile)
|
||||
{
|
||||
Status = EStatus.Failed;
|
||||
LastError = $"Cannot load asset bundle file using {nameof(ResourcePackage.LoadRawFileAsync)} method !";
|
||||
YooLogger.Error(LastError);
|
||||
InvokeCompletion();
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = EStatus.Failed;
|
||||
LastError = $"The bundle {OwnerBundle.MainBundleInfo.Bundle.BundleName} has been destroyed by unity bugs !";
|
||||
YooLogger.Error(LastError);
|
||||
InvokeCompletion();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步操作任务
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue