mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-31 05:58:47 +00:00
Update YooAssets.cs
检测原生文件加载方法,预防传入无效文件。
This commit is contained in:
@@ -119,11 +119,6 @@ namespace YooAsset
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 错误信息
|
|
||||||
/// </summary>
|
|
||||||
public string Error { private set; get; }
|
|
||||||
|
|
||||||
|
|
||||||
private BundleInfo()
|
private BundleInfo()
|
||||||
{
|
{
|
||||||
@@ -136,7 +131,6 @@ namespace YooAsset
|
|||||||
RemoteMainURL = mainURL;
|
RemoteMainURL = mainURL;
|
||||||
RemoteFallbackURL = fallbackURL;
|
RemoteFallbackURL = fallbackURL;
|
||||||
EditorAssetPath = string.Empty;
|
EditorAssetPath = string.Empty;
|
||||||
Error = string.Empty;
|
|
||||||
}
|
}
|
||||||
public BundleInfo(PatchBundle patchBundle, ELoadMode loadMode, string editorAssetPath)
|
public BundleInfo(PatchBundle patchBundle, ELoadMode loadMode, string editorAssetPath)
|
||||||
{
|
{
|
||||||
@@ -146,7 +140,6 @@ namespace YooAsset
|
|||||||
RemoteMainURL = string.Empty;
|
RemoteMainURL = string.Empty;
|
||||||
RemoteFallbackURL = string.Empty;
|
RemoteFallbackURL = string.Empty;
|
||||||
EditorAssetPath = editorAssetPath;
|
EditorAssetPath = editorAssetPath;
|
||||||
Error = string.Empty;
|
|
||||||
}
|
}
|
||||||
public BundleInfo(PatchBundle patchBundle, ELoadMode loadMode)
|
public BundleInfo(PatchBundle patchBundle, ELoadMode loadMode)
|
||||||
{
|
{
|
||||||
@@ -156,17 +149,6 @@ namespace YooAsset
|
|||||||
RemoteMainURL = string.Empty;
|
RemoteMainURL = string.Empty;
|
||||||
RemoteFallbackURL = string.Empty;
|
RemoteFallbackURL = string.Empty;
|
||||||
EditorAssetPath = string.Empty;
|
EditorAssetPath = string.Empty;
|
||||||
Error = string.Empty;
|
|
||||||
}
|
|
||||||
public BundleInfo(string error)
|
|
||||||
{
|
|
||||||
_patchBundle = null;
|
|
||||||
LoadMode = ELoadMode.None;
|
|
||||||
BundleName = string.Empty;
|
|
||||||
RemoteMainURL = string.Empty;
|
|
||||||
RemoteFallbackURL = string.Empty;
|
|
||||||
EditorAssetPath = string.Empty;
|
|
||||||
Error = error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -536,6 +536,15 @@ namespace YooAsset
|
|||||||
}
|
}
|
||||||
|
|
||||||
BundleInfo bundleInfo = _bundleServices.GetBundleInfo(assetInfo);
|
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)
|
if (_playMode == EPlayMode.EditorSimulateMode)
|
||||||
{
|
{
|
||||||
RawFileOperation operation = new EditorPlayModeRawFileOperation(bundleInfo, copyPath);
|
RawFileOperation operation = new EditorPlayModeRawFileOperation(bundleInfo, copyPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user