fix #171
parent
87432fddc9
commit
7ba40e5c88
|
@ -368,17 +368,7 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
DebugCheckInitialize();
|
DebugCheckInitialize();
|
||||||
AssetInfo assetInfo = ConvertLocationToAssetInfo(location, null);
|
AssetInfo assetInfo = ConvertLocationToAssetInfo(location, null);
|
||||||
if (assetInfo.IsInvalid)
|
return IsNeedDownloadFromRemoteInternal(assetInfo);
|
||||||
{
|
|
||||||
YooLogger.Warning(assetInfo.Error);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
BundleInfo bundleInfo = _bundleServices.GetBundleInfo(assetInfo);
|
|
||||||
if (bundleInfo.LoadMode == BundleInfo.ELoadMode.LoadFromRemote)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -388,17 +378,7 @@ namespace YooAsset
|
||||||
public bool IsNeedDownloadFromRemote(AssetInfo assetInfo)
|
public bool IsNeedDownloadFromRemote(AssetInfo assetInfo)
|
||||||
{
|
{
|
||||||
DebugCheckInitialize();
|
DebugCheckInitialize();
|
||||||
if (assetInfo.IsInvalid)
|
return IsNeedDownloadFromRemoteInternal(assetInfo);
|
||||||
{
|
|
||||||
YooLogger.Warning(assetInfo.Error);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
BundleInfo bundleInfo = _bundleServices.GetBundleInfo(assetInfo);
|
|
||||||
if (bundleInfo.LoadMode == BundleInfo.ELoadMode.LoadFromRemote)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -452,6 +432,28 @@ namespace YooAsset
|
||||||
string assetPath = _playModeServices.ActiveManifest.TryMappingToAssetPath(location);
|
string assetPath = _playModeServices.ActiveManifest.TryMappingToAssetPath(location);
|
||||||
return string.IsNullOrEmpty(assetPath) == false;
|
return string.IsNullOrEmpty(assetPath) == false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool IsNeedDownloadFromRemoteInternal(AssetInfo assetInfo)
|
||||||
|
{
|
||||||
|
if (assetInfo.IsInvalid)
|
||||||
|
{
|
||||||
|
YooLogger.Warning(assetInfo.Error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
BundleInfo bundleInfo = _bundleServices.GetBundleInfo(assetInfo);
|
||||||
|
if (bundleInfo.LoadMode == BundleInfo.ELoadMode.LoadFromRemote)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
BundleInfo[] depends = _bundleServices.GetAllDependBundleInfos(assetInfo);
|
||||||
|
foreach (var depend in depends)
|
||||||
|
{
|
||||||
|
if (depend.LoadMode == BundleInfo.ELoadMode.LoadFromRemote)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 原生文件
|
#region 原生文件
|
||||||
|
|
Loading…
Reference in New Issue