mirror of https://github.com/tuyoogame/YooAsset
update resource package
parent
8fe2fa7bc6
commit
eb98eaeb3b
|
@ -348,7 +348,7 @@ namespace YooAsset
|
||||||
}
|
}
|
||||||
internal List<BundleLoaderBase> CreateDependAssetBundleLoaders(AssetInfo assetInfo)
|
internal List<BundleLoaderBase> CreateDependAssetBundleLoaders(AssetInfo assetInfo)
|
||||||
{
|
{
|
||||||
BundleInfo[] depends = _bundleQuery.GetAllDependBundleInfos(assetInfo);
|
BundleInfo[] depends = _bundleQuery.GetDependBundleInfos(assetInfo);
|
||||||
List<BundleLoaderBase> result = new List<BundleLoaderBase>(depends.Length);
|
List<BundleLoaderBase> result = new List<BundleLoaderBase>(depends.Length);
|
||||||
foreach (var bundleInfo in depends)
|
foreach (var bundleInfo in depends)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取依赖的资源包信息集合
|
/// 获取依赖的资源包信息集合
|
||||||
/// </summary>
|
/// </summary>
|
||||||
BundleInfo[] GetAllDependBundleInfos(AssetInfo assetPath);
|
BundleInfo[] GetDependBundleInfos(AssetInfo assetPath);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 清单是否有效
|
/// 清单是否有效
|
||||||
|
|
|
@ -111,7 +111,7 @@ namespace YooAsset
|
||||||
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
||||||
return CreateBundleInfo(packageBundle, assetInfo);
|
return CreateBundleInfo(packageBundle, assetInfo);
|
||||||
}
|
}
|
||||||
BundleInfo[] IBundleQuery.GetAllDependBundleInfos(AssetInfo assetInfo)
|
BundleInfo[] IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
|
||||||
{
|
{
|
||||||
if (assetInfo.IsInvalid)
|
if (assetInfo.IsInvalid)
|
||||||
throw new Exception("Should never get here !");
|
throw new Exception("Should never get here !");
|
||||||
|
|
|
@ -366,7 +366,7 @@ namespace YooAsset
|
||||||
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
||||||
return CreateBundleInfo(packageBundle);
|
return CreateBundleInfo(packageBundle);
|
||||||
}
|
}
|
||||||
BundleInfo[] IBundleQuery.GetAllDependBundleInfos(AssetInfo assetInfo)
|
BundleInfo[] IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
|
||||||
{
|
{
|
||||||
if (assetInfo.IsInvalid)
|
if (assetInfo.IsInvalid)
|
||||||
throw new Exception("Should never get here !");
|
throw new Exception("Should never get here !");
|
||||||
|
|
|
@ -195,7 +195,7 @@ namespace YooAsset
|
||||||
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
||||||
return CreateBundleInfo(packageBundle);
|
return CreateBundleInfo(packageBundle);
|
||||||
}
|
}
|
||||||
BundleInfo[] IBundleQuery.GetAllDependBundleInfos(AssetInfo assetInfo)
|
BundleInfo[] IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
|
||||||
{
|
{
|
||||||
if (assetInfo.IsInvalid)
|
if (assetInfo.IsInvalid)
|
||||||
throw new Exception("Should never get here !");
|
throw new Exception("Should never get here !");
|
||||||
|
|
|
@ -144,7 +144,7 @@ namespace YooAsset
|
||||||
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
||||||
return CreateBundleInfo(packageBundle);
|
return CreateBundleInfo(packageBundle);
|
||||||
}
|
}
|
||||||
BundleInfo[] IBundleQuery.GetAllDependBundleInfos(AssetInfo assetInfo)
|
BundleInfo[] IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
|
||||||
{
|
{
|
||||||
if (assetInfo.IsInvalid)
|
if (assetInfo.IsInvalid)
|
||||||
throw new Exception("Should never get here !");
|
throw new Exception("Should never get here !");
|
||||||
|
|
|
@ -403,17 +403,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 = _bundleQuery.GetMainBundleInfo(assetInfo);
|
|
||||||
if (bundleInfo.LoadMode == BundleInfo.ELoadMode.LoadFromRemote)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -423,17 +413,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 = _bundleQuery.GetMainBundleInfo(assetInfo);
|
|
||||||
if (bundleInfo.LoadMode == BundleInfo.ELoadMode.LoadFromRemote)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -487,6 +467,28 @@ namespace YooAsset
|
||||||
string assetPath = _playModeImpl.ActiveManifest.TryMappingToAssetPath(location);
|
string assetPath = _playModeImpl.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 = _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
|
#endregion
|
||||||
|
|
||||||
#region 原生文件
|
#region 原生文件
|
||||||
|
|
Loading…
Reference in New Issue