mirror of https://github.com/tuyoogame/YooAsset
parent
ec25af8517
commit
53b53eb0a0
|
@ -141,7 +141,7 @@ namespace YooAsset
|
|||
if (assetInfo.IsInvalid)
|
||||
{
|
||||
CompletedProvider completedProvider = new CompletedProvider(assetInfo);
|
||||
completedProvider.SetCompleted();
|
||||
completedProvider.SetCompleted(assetInfo.Error);
|
||||
return completedProvider.CreateHandle<SceneOperationHandle>();
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ namespace YooAsset
|
|||
if (assetInfo.IsInvalid)
|
||||
{
|
||||
CompletedProvider completedProvider = new CompletedProvider(assetInfo);
|
||||
completedProvider.SetCompleted();
|
||||
completedProvider.SetCompleted(assetInfo.Error);
|
||||
return completedProvider.CreateHandle<AssetOperationHandle>();
|
||||
}
|
||||
|
||||
|
@ -202,7 +202,7 @@ namespace YooAsset
|
|||
if (assetInfo.IsInvalid)
|
||||
{
|
||||
CompletedProvider completedProvider = new CompletedProvider(assetInfo);
|
||||
completedProvider.SetCompleted();
|
||||
completedProvider.SetCompleted(assetInfo.Error);
|
||||
return completedProvider.CreateHandle<SubAssetsOperationHandle>();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,12 +20,12 @@ namespace YooAsset
|
|||
public override void Update()
|
||||
{
|
||||
}
|
||||
public void SetCompleted()
|
||||
public void SetCompleted(string error)
|
||||
{
|
||||
if (Status == EStatus.None)
|
||||
{
|
||||
Status = EStatus.Fail;
|
||||
LastError = MainAssetInfo.Error;
|
||||
LastError = error;
|
||||
InvokeCompletion();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -522,15 +522,17 @@ namespace YooAsset
|
|||
return operation;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
BundleInfo bundleInfo = _bundleServices.GetBundleInfo(assetInfo);
|
||||
if (bundleInfo.Bundle.IsRawFile == false)
|
||||
{
|
||||
string error = $"Cannot load asset bundle file using {nameof(GetRawFileAsync)} interfaces !";
|
||||
YooLogger.Warning(error);
|
||||
string error = $"Cannot load asset bundle file using {nameof(GetRawFileAsync)} method !";
|
||||
YooLogger.Error(error);
|
||||
RawFileOperation operation = new CompletedRawFileOperation(error, copyPath);
|
||||
OperationSystem.StartOperation(operation);
|
||||
return operation;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (_playMode == EPlayMode.EditorSimulateMode)
|
||||
{
|
||||
|
@ -667,6 +669,18 @@ namespace YooAsset
|
|||
|
||||
private static AssetOperationHandle LoadAssetInternal(AssetInfo assetInfo, bool waitForAsyncComplete)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
BundleInfo bundleInfo = _bundleServices.GetBundleInfo(assetInfo);
|
||||
if (bundleInfo.Bundle.IsRawFile)
|
||||
{
|
||||
string error = $"Cannot load raw file using LoadAsset method !";
|
||||
YooLogger.Error(error);
|
||||
CompletedProvider completedProvider = new CompletedProvider(assetInfo);
|
||||
completedProvider.SetCompleted(error);
|
||||
return completedProvider.CreateHandle<AssetOperationHandle>();
|
||||
}
|
||||
#endif
|
||||
|
||||
var handle = AssetSystem.LoadAssetAsync(assetInfo);
|
||||
if (waitForAsyncComplete)
|
||||
handle.WaitForAsyncComplete();
|
||||
|
@ -751,6 +765,18 @@ namespace YooAsset
|
|||
|
||||
private static SubAssetsOperationHandle LoadSubAssetsInternal(AssetInfo assetInfo, bool waitForAsyncComplete)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
BundleInfo bundleInfo = _bundleServices.GetBundleInfo(assetInfo);
|
||||
if (bundleInfo.Bundle.IsRawFile)
|
||||
{
|
||||
string error = $"Cannot load raw file using LoadSubAssets method !";
|
||||
YooLogger.Error(error);
|
||||
CompletedProvider completedProvider = new CompletedProvider(assetInfo);
|
||||
completedProvider.SetCompleted(error);
|
||||
return completedProvider.CreateHandle<SubAssetsOperationHandle>();
|
||||
}
|
||||
#endif
|
||||
|
||||
var handle = AssetSystem.LoadSubAssetsAsync(assetInfo);
|
||||
if (waitForAsyncComplete)
|
||||
handle.WaitForAsyncComplete();
|
||||
|
|
Loading…
Reference in New Issue