mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-26 02:30:18 +00:00
update asset system
真机上使用错误方法加载原生文件的时候给予正确的错误提示。
This commit is contained in:
@@ -53,6 +53,12 @@ namespace YooAsset
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (OwnerBundle.CacheBundle == null)
|
||||||
|
{
|
||||||
|
ProcessCacheBundleException();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Status = EStatus.Loading;
|
Status = EStatus.Loading;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,12 +55,7 @@ namespace YooAsset
|
|||||||
|
|
||||||
if (OwnerBundle.CacheBundle == null)
|
if (OwnerBundle.CacheBundle == null)
|
||||||
{
|
{
|
||||||
if (OwnerBundle.IsDestroyed)
|
ProcessCacheBundleException();
|
||||||
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();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,12 @@ namespace YooAsset
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (OwnerBundle.CacheBundle == null)
|
||||||
|
{
|
||||||
|
ProcessCacheBundleException();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Status = EStatus.Loading;
|
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>
|
||||||
/// 异步操作任务
|
/// 异步操作任务
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user