Update YooAssets.cs

检测原生文件加载方法,预防传入无效文件。
This commit is contained in:
hevinci
2022-07-05 20:07:32 +08:00
parent 63f90e1537
commit 7d5b6504f4
2 changed files with 9 additions and 18 deletions

View File

@@ -536,6 +536,15 @@ namespace YooAsset
}
BundleInfo bundleInfo = _bundleServices.GetBundleInfo(assetInfo);
if (bundleInfo.IsRawFile == false)
{
string error = $"Cannot load asset bundle file using {nameof(GetRawFileAsync)} interfaces !";
YooLogger.Warning(error);
RawFileOperation operation = new CompletedRawFileOperation(error, copyPath);
OperationSystem.StartOperaiton(operation);
return operation;
}
if (_playMode == EPlayMode.EditorSimulateMode)
{
RawFileOperation operation = new EditorPlayModeRawFileOperation(bundleInfo, copyPath);