mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-14 19:40:47 +00:00
update resource package
This commit is contained in:
@@ -348,7 +348,7 @@ namespace YooAsset
|
||||
}
|
||||
internal List<BundleLoaderBase> CreateDependAssetBundleLoaders(AssetInfo assetInfo)
|
||||
{
|
||||
BundleInfo[] depends = _bundleQuery.GetAllDependBundleInfos(assetInfo);
|
||||
BundleInfo[] depends = _bundleQuery.GetDependBundleInfos(assetInfo);
|
||||
List<BundleLoaderBase> result = new List<BundleLoaderBase>(depends.Length);
|
||||
foreach (var bundleInfo in depends)
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace YooAsset
|
||||
/// <summary>
|
||||
/// 获取依赖的资源包信息集合
|
||||
/// </summary>
|
||||
BundleInfo[] GetAllDependBundleInfos(AssetInfo assetPath);
|
||||
BundleInfo[] GetDependBundleInfos(AssetInfo assetPath);
|
||||
|
||||
/// <summary>
|
||||
/// 清单是否有效
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace YooAsset
|
||||
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
||||
return CreateBundleInfo(packageBundle, assetInfo);
|
||||
}
|
||||
BundleInfo[] IBundleQuery.GetAllDependBundleInfos(AssetInfo assetInfo)
|
||||
BundleInfo[] IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
|
||||
{
|
||||
if (assetInfo.IsInvalid)
|
||||
throw new Exception("Should never get here !");
|
||||
|
||||
@@ -366,7 +366,7 @@ namespace YooAsset
|
||||
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
||||
return CreateBundleInfo(packageBundle);
|
||||
}
|
||||
BundleInfo[] IBundleQuery.GetAllDependBundleInfos(AssetInfo assetInfo)
|
||||
BundleInfo[] IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
|
||||
{
|
||||
if (assetInfo.IsInvalid)
|
||||
throw new Exception("Should never get here !");
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace YooAsset
|
||||
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
||||
return CreateBundleInfo(packageBundle);
|
||||
}
|
||||
BundleInfo[] IBundleQuery.GetAllDependBundleInfos(AssetInfo assetInfo)
|
||||
BundleInfo[] IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
|
||||
{
|
||||
if (assetInfo.IsInvalid)
|
||||
throw new Exception("Should never get here !");
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace YooAsset
|
||||
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
||||
return CreateBundleInfo(packageBundle);
|
||||
}
|
||||
BundleInfo[] IBundleQuery.GetAllDependBundleInfos(AssetInfo assetInfo)
|
||||
BundleInfo[] IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
|
||||
{
|
||||
if (assetInfo.IsInvalid)
|
||||
throw new Exception("Should never get here !");
|
||||
|
||||
@@ -403,17 +403,7 @@ namespace YooAsset
|
||||
{
|
||||
DebugCheckInitialize();
|
||||
AssetInfo assetInfo = ConvertLocationToAssetInfo(location, null);
|
||||
if (assetInfo.IsInvalid)
|
||||
{
|
||||
YooLogger.Warning(assetInfo.Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
BundleInfo bundleInfo = _bundleQuery.GetMainBundleInfo(assetInfo);
|
||||
if (bundleInfo.LoadMode == BundleInfo.ELoadMode.LoadFromRemote)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
return IsNeedDownloadFromRemoteInternal(assetInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -423,17 +413,7 @@ namespace YooAsset
|
||||
public bool IsNeedDownloadFromRemote(AssetInfo assetInfo)
|
||||
{
|
||||
DebugCheckInitialize();
|
||||
if (assetInfo.IsInvalid)
|
||||
{
|
||||
YooLogger.Warning(assetInfo.Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
BundleInfo bundleInfo = _bundleQuery.GetMainBundleInfo(assetInfo);
|
||||
if (bundleInfo.LoadMode == BundleInfo.ELoadMode.LoadFromRemote)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
return IsNeedDownloadFromRemoteInternal(assetInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -487,6 +467,28 @@ namespace YooAsset
|
||||
string assetPath = _playModeImpl.ActiveManifest.TryMappingToAssetPath(location);
|
||||
return string.IsNullOrEmpty(assetPath) == false;
|
||||
}
|
||||
|
||||
private bool IsNeedDownloadFromRemoteInternal(AssetInfo assetInfo)
|
||||
{
|
||||
if (assetInfo.IsInvalid)
|
||||
{
|
||||
YooLogger.Warning(assetInfo.Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
BundleInfo bundleInfo = _bundleQuery.GetMainBundleInfo(assetInfo);
|
||||
if (bundleInfo.LoadMode == BundleInfo.ELoadMode.LoadFromRemote)
|
||||
return true;
|
||||
|
||||
BundleInfo[] depends = _bundleQuery.GetDependBundleInfos(assetInfo);
|
||||
foreach (var depend in depends)
|
||||
{
|
||||
if (depend.LoadMode == BundleInfo.ELoadMode.LoadFromRemote)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 原生文件
|
||||
|
||||
Reference in New Issue
Block a user