mirror of https://github.com/tuyoogame/YooAsset
[optimize]使用Unity Pool对List回收使用
parent
4c619778c3
commit
6e67b21ee3
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Pool;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
|
@ -9,7 +10,7 @@ namespace YooAsset
|
|||
/// <summary>
|
||||
/// 依赖的资源包加载器列表
|
||||
/// </summary>
|
||||
internal readonly List<BundleLoaderBase> DependList;
|
||||
internal List<BundleLoaderBase> DependList { private set; get; }
|
||||
|
||||
|
||||
public DependAssetBundles(List<BundleLoaderBase> dpendList)
|
||||
|
@ -92,6 +93,8 @@ namespace YooAsset
|
|||
{
|
||||
loader.Release();
|
||||
}
|
||||
ListPool<BundleLoaderBase>.Release(DependList);
|
||||
DependList = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Pool;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace YooAsset
|
||||
|
@ -107,7 +108,7 @@ namespace YooAsset
|
|||
}
|
||||
|
||||
// 卸载依赖资源包加载器
|
||||
string[] dependBundleNames = _bundleQuery.GetDependBundleNames(assetInfo);
|
||||
var dependBundleNames = _bundleQuery.GetDependBundleNames(assetInfo);
|
||||
foreach (var dependBundleName in dependBundleNames)
|
||||
{
|
||||
var dependLoader = TryGetAssetBundleLoader(dependBundleName);
|
||||
|
@ -122,6 +123,7 @@ namespace YooAsset
|
|||
}
|
||||
}
|
||||
}
|
||||
ListPool<string>.Release(dependBundleNames);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -392,13 +394,14 @@ namespace YooAsset
|
|||
}
|
||||
internal List<BundleLoaderBase> CreateDependAssetBundleLoaders(AssetInfo assetInfo)
|
||||
{
|
||||
BundleInfo[] depends = _bundleQuery.GetDependBundleInfos(assetInfo);
|
||||
List<BundleLoaderBase> result = new List<BundleLoaderBase>(depends.Length);
|
||||
List<BundleInfo> depends = _bundleQuery.GetDependBundleInfos(assetInfo);
|
||||
List<BundleLoaderBase> result = ListPool<BundleLoaderBase>.Get();
|
||||
foreach (var bundleInfo in depends)
|
||||
{
|
||||
BundleLoaderBase dependLoader = CreateAssetBundleLoaderInternal(bundleInfo);
|
||||
result.Add(dependLoader);
|
||||
}
|
||||
ListPool<BundleInfo>.Release(depends);
|
||||
return result;
|
||||
}
|
||||
internal void RemoveBundleProviders(List<ProviderBase> removeList)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Pool;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
|
@ -186,6 +187,7 @@ namespace YooAsset
|
|||
var bundleInfo = CreateUnpackInfo(assist, packageBundle);
|
||||
result.Add(bundleInfo);
|
||||
}
|
||||
ListPool<PackageBundle>.Release(unpackList);
|
||||
return result;
|
||||
}
|
||||
private static BundleInfo CreateUnpackInfo(ResourceAssist assist, PackageBundle packageBundle)
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
internal interface IBundleQuery
|
||||
|
@ -11,7 +13,7 @@ namespace YooAsset
|
|||
/// <summary>
|
||||
/// 获取依赖的资源包信息集合
|
||||
/// </summary>
|
||||
BundleInfo[] GetDependBundleInfos(AssetInfo assetPath);
|
||||
List<BundleInfo> GetDependBundleInfos(AssetInfo assetPath);
|
||||
|
||||
/// <summary>
|
||||
/// 获取主资源包名称
|
||||
|
@ -21,7 +23,7 @@ namespace YooAsset
|
|||
/// <summary>
|
||||
/// 获取依赖的资源包名称集合
|
||||
/// </summary>
|
||||
string[] GetDependBundleNames(AssetInfo assetInfo);
|
||||
List<string> GetDependBundleNames(AssetInfo assetInfo);
|
||||
|
||||
/// <summary>
|
||||
/// 清单是否有效
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.IO;
|
|||
using System.Diagnostics;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Pool;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
|
@ -146,10 +147,10 @@ namespace YooAsset
|
|||
/// 获取资源依赖列表
|
||||
/// 注意:传入的资源路径一定合法有效!
|
||||
/// </summary>
|
||||
public PackageBundle[] GetAllDependencies(string assetPath)
|
||||
public List<PackageBundle> GetAllDependencies(string assetPath)
|
||||
{
|
||||
var packageBundle = GetMainPackageBundle(assetPath);
|
||||
List<PackageBundle> result = new List<PackageBundle>(packageBundle.DependIDs.Length);
|
||||
var result = ListPool<PackageBundle>.Get();
|
||||
foreach (var dependID in packageBundle.DependIDs)
|
||||
{
|
||||
if (dependID >= 0 && dependID < BundleList.Count)
|
||||
|
@ -162,7 +163,7 @@ namespace YooAsset
|
|||
throw new Exception($"Invalid bundle id : {dependID} Asset path : {assetPath}");
|
||||
}
|
||||
}
|
||||
return result.ToArray();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Pool;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
|
@ -114,20 +115,21 @@ namespace YooAsset
|
|||
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
||||
return CreateBundleInfo(packageBundle, assetInfo);
|
||||
}
|
||||
BundleInfo[] IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
|
||||
List<BundleInfo> IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
|
||||
{
|
||||
if (assetInfo.IsInvalid)
|
||||
throw new Exception("Should never get here !");
|
||||
|
||||
// 注意:如果清单里未找到资源包会抛出异常!
|
||||
var depends = _activeManifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<BundleInfo> result = new List<BundleInfo>(depends.Length);
|
||||
List<PackageBundle> depends = _activeManifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<BundleInfo> result = ListPool<BundleInfo>.Get();
|
||||
foreach (var packageBundle in depends)
|
||||
{
|
||||
BundleInfo bundleInfo = CreateBundleInfo(packageBundle, assetInfo);
|
||||
result.Add(bundleInfo);
|
||||
}
|
||||
return result.ToArray();
|
||||
ListPool<PackageBundle>.Release(depends);
|
||||
return result;
|
||||
}
|
||||
string IBundleQuery.GetMainBundleName(AssetInfo assetInfo)
|
||||
{
|
||||
|
@ -138,19 +140,20 @@ namespace YooAsset
|
|||
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
||||
return packageBundle.BundleName;
|
||||
}
|
||||
string[] IBundleQuery.GetDependBundleNames(AssetInfo assetInfo)
|
||||
List<string> IBundleQuery.GetDependBundleNames(AssetInfo assetInfo)
|
||||
{
|
||||
if (assetInfo.IsInvalid)
|
||||
throw new Exception("Should never get here !");
|
||||
|
||||
// 注意:如果清单里未找到资源包会抛出异常!
|
||||
var depends = _activeManifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<string> result = new List<string>(depends.Length);
|
||||
List<PackageBundle> depends = _activeManifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<string> result = ListPool<string>.Get();
|
||||
foreach (var packageBundle in depends)
|
||||
{
|
||||
result.Add(packageBundle.BundleName);
|
||||
}
|
||||
return result.ToArray();
|
||||
ListPool<PackageBundle>.Release(depends);
|
||||
return result;
|
||||
}
|
||||
bool IBundleQuery.ManifestValid()
|
||||
{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Pool;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
|
@ -60,6 +61,7 @@ namespace YooAsset
|
|||
var bundleInfo = ConvertToDownloadInfo(packageBundle);
|
||||
result.Add(bundleInfo);
|
||||
}
|
||||
ListPool<PackageBundle>.Release(downloadList);
|
||||
return result;
|
||||
}
|
||||
private BundleInfo ConvertToDownloadInfo(PackageBundle packageBundle)
|
||||
|
@ -133,7 +135,7 @@ namespace YooAsset
|
|||
}
|
||||
public List<BundleInfo> GetDownloadListByAll(PackageManifest manifest)
|
||||
{
|
||||
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
||||
List<PackageBundle> downloadList = ListPool<PackageBundle>.Get();
|
||||
foreach (var packageBundle in manifest.BundleList)
|
||||
{
|
||||
// 忽略分发文件
|
||||
|
@ -162,7 +164,7 @@ namespace YooAsset
|
|||
}
|
||||
public List<BundleInfo> GetDownloadListByTags(PackageManifest manifest, string[] tags)
|
||||
{
|
||||
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
||||
List<PackageBundle> downloadList = ListPool<PackageBundle>.Get();
|
||||
foreach (var packageBundle in manifest.BundleList)
|
||||
{
|
||||
// 忽略分发文件
|
||||
|
@ -219,15 +221,16 @@ namespace YooAsset
|
|||
checkList.Add(mainBundle);
|
||||
|
||||
// 注意:如果清单里未找到资源包会抛出异常!
|
||||
PackageBundle[] dependBundles = manifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<PackageBundle> dependBundles = manifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
foreach (var dependBundle in dependBundles)
|
||||
{
|
||||
if (checkList.Contains(dependBundle) == false)
|
||||
checkList.Add(dependBundle);
|
||||
}
|
||||
ListPool<PackageBundle>.Release(dependBundles);
|
||||
}
|
||||
|
||||
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
||||
List<PackageBundle> downloadList = ListPool<PackageBundle>.Get();
|
||||
foreach (var packageBundle in checkList)
|
||||
{
|
||||
// 忽略分发文件
|
||||
|
@ -256,7 +259,7 @@ namespace YooAsset
|
|||
}
|
||||
private List<BundleInfo> GetUnpackListByAll(PackageManifest manifest)
|
||||
{
|
||||
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
||||
List<PackageBundle> downloadList = ListPool<PackageBundle>.Get();
|
||||
foreach (var packageBundle in manifest.BundleList)
|
||||
{
|
||||
// 忽略缓存文件
|
||||
|
@ -280,7 +283,7 @@ namespace YooAsset
|
|||
}
|
||||
private List<BundleInfo> GetUnpackListByTags(PackageManifest manifest, string[] tags)
|
||||
{
|
||||
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
||||
List<PackageBundle> downloadList = ListPool<PackageBundle>.Get();
|
||||
foreach (var packageBundle in manifest.BundleList)
|
||||
{
|
||||
// 忽略缓存文件
|
||||
|
@ -370,20 +373,21 @@ namespace YooAsset
|
|||
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
||||
return CreateBundleInfo(packageBundle);
|
||||
}
|
||||
BundleInfo[] IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
|
||||
List<BundleInfo> IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
|
||||
{
|
||||
if (assetInfo.IsInvalid)
|
||||
throw new Exception("Should never get here !");
|
||||
|
||||
// 注意:如果清单里未找到资源包会抛出异常!
|
||||
var depends = _activeManifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<BundleInfo> result = new List<BundleInfo>(depends.Length);
|
||||
List<PackageBundle> depends = _activeManifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<BundleInfo> result = ListPool<BundleInfo>.Get();
|
||||
foreach (var packageBundle in depends)
|
||||
{
|
||||
BundleInfo bundleInfo = CreateBundleInfo(packageBundle);
|
||||
result.Add(bundleInfo);
|
||||
}
|
||||
return result.ToArray();
|
||||
ListPool<PackageBundle>.Release(depends);
|
||||
return result;
|
||||
}
|
||||
string IBundleQuery.GetMainBundleName(AssetInfo assetInfo)
|
||||
{
|
||||
|
@ -394,19 +398,20 @@ namespace YooAsset
|
|||
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
||||
return packageBundle.BundleName;
|
||||
}
|
||||
string[] IBundleQuery.GetDependBundleNames(AssetInfo assetInfo)
|
||||
List<string> IBundleQuery.GetDependBundleNames(AssetInfo assetInfo)
|
||||
{
|
||||
if (assetInfo.IsInvalid)
|
||||
throw new Exception("Should never get here !");
|
||||
|
||||
// 注意:如果清单里未找到资源包会抛出异常!
|
||||
var depends = _activeManifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<string> result = new List<string>(depends.Length);
|
||||
List<PackageBundle> depends = _activeManifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<string> result = ListPool<string>.Get();
|
||||
foreach (var packageBundle in depends)
|
||||
{
|
||||
result.Add(packageBundle.BundleName);
|
||||
}
|
||||
return result.ToArray();
|
||||
ListPool<PackageBundle>.Release(depends);
|
||||
return result;
|
||||
}
|
||||
bool IBundleQuery.ManifestValid()
|
||||
{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Pool;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
|
@ -103,7 +104,7 @@ namespace YooAsset
|
|||
}
|
||||
private List<BundleInfo> GetUnpackListByAll(PackageManifest manifest)
|
||||
{
|
||||
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
||||
List<PackageBundle> downloadList = ListPool<PackageBundle>.Get();
|
||||
foreach (var packageBundle in manifest.BundleList)
|
||||
{
|
||||
// 忽略缓存文件
|
||||
|
@ -124,7 +125,7 @@ namespace YooAsset
|
|||
}
|
||||
private List<BundleInfo> GetUnpackListByTags(PackageManifest manifest, string[] tags)
|
||||
{
|
||||
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
||||
List<PackageBundle> downloadList = ListPool<PackageBundle>.Get();
|
||||
foreach (var packageBundle in manifest.BundleList)
|
||||
{
|
||||
// 忽略缓存文件
|
||||
|
@ -199,20 +200,21 @@ namespace YooAsset
|
|||
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
||||
return CreateBundleInfo(packageBundle);
|
||||
}
|
||||
BundleInfo[] IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
|
||||
List<BundleInfo> IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
|
||||
{
|
||||
if (assetInfo.IsInvalid)
|
||||
throw new Exception("Should never get here !");
|
||||
|
||||
// 注意:如果清单里未找到资源包会抛出异常!
|
||||
var depends = _activeManifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<BundleInfo> result = new List<BundleInfo>(depends.Length);
|
||||
List<PackageBundle> depends = _activeManifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<BundleInfo> result = ListPool<BundleInfo>.Get();
|
||||
foreach (var packageBundle in depends)
|
||||
{
|
||||
BundleInfo bundleInfo = CreateBundleInfo(packageBundle);
|
||||
result.Add(bundleInfo);
|
||||
}
|
||||
return result.ToArray();
|
||||
ListPool<PackageBundle>.Release(depends);
|
||||
return result;
|
||||
}
|
||||
string IBundleQuery.GetMainBundleName(AssetInfo assetInfo)
|
||||
{
|
||||
|
@ -223,19 +225,20 @@ namespace YooAsset
|
|||
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
||||
return packageBundle.BundleName;
|
||||
}
|
||||
string[] IBundleQuery.GetDependBundleNames(AssetInfo assetInfo)
|
||||
List<string> IBundleQuery.GetDependBundleNames(AssetInfo assetInfo)
|
||||
{
|
||||
if (assetInfo.IsInvalid)
|
||||
throw new Exception("Should never get here !");
|
||||
|
||||
// 注意:如果清单里未找到资源包会抛出异常!
|
||||
var depends = _activeManifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<string> result = new List<string>(depends.Length);
|
||||
List<PackageBundle> depends = _activeManifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<string> result = ListPool<string>.Get();
|
||||
foreach (var packageBundle in depends)
|
||||
{
|
||||
result.Add(packageBundle.BundleName);
|
||||
}
|
||||
return result.ToArray();
|
||||
ListPool<PackageBundle>.Release(depends);
|
||||
return result;
|
||||
}
|
||||
bool IBundleQuery.ManifestValid()
|
||||
{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Pool;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
|
@ -61,6 +62,7 @@ namespace YooAsset
|
|||
var bundleInfo = ConvertToDownloadInfo(packageBundle);
|
||||
result.Add(bundleInfo);
|
||||
}
|
||||
ListPool<PackageBundle>.Release(downloadList);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -130,7 +132,7 @@ namespace YooAsset
|
|||
}
|
||||
public List<BundleInfo> GetDownloadListByAll(PackageManifest manifest)
|
||||
{
|
||||
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
||||
List<PackageBundle> downloadList = ListPool<PackageBundle>.Get();
|
||||
foreach (var packageBundle in manifest.BundleList)
|
||||
{
|
||||
// 忽略缓存文件
|
||||
|
@ -155,7 +157,7 @@ namespace YooAsset
|
|||
}
|
||||
public List<BundleInfo> GetDownloadListByTags(PackageManifest manifest, string[] tags)
|
||||
{
|
||||
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
||||
List<PackageBundle> downloadList = ListPool<PackageBundle>.Get();
|
||||
foreach (var packageBundle in manifest.BundleList)
|
||||
{
|
||||
// 忽略缓存文件
|
||||
|
@ -208,15 +210,16 @@ namespace YooAsset
|
|||
checkList.Add(mainBundle);
|
||||
|
||||
// 注意:如果清单里未找到资源包会抛出异常!
|
||||
PackageBundle[] dependBundles = manifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<PackageBundle> dependBundles = manifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
foreach (var dependBundle in dependBundles)
|
||||
{
|
||||
if (checkList.Contains(dependBundle) == false)
|
||||
checkList.Add(dependBundle);
|
||||
}
|
||||
ListPool<PackageBundle>.Release(dependBundles);
|
||||
}
|
||||
|
||||
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
||||
List<PackageBundle> downloadList = ListPool<PackageBundle>.Get();
|
||||
foreach (var packageBundle in checkList)
|
||||
{
|
||||
// 忽略缓存文件
|
||||
|
@ -273,20 +276,21 @@ namespace YooAsset
|
|||
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
||||
return CreateBundleInfo(packageBundle);
|
||||
}
|
||||
BundleInfo[] IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
|
||||
List<BundleInfo> IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
|
||||
{
|
||||
if (assetInfo.IsInvalid)
|
||||
throw new Exception("Should never get here !");
|
||||
|
||||
// 注意:如果清单里未找到资源包会抛出异常!
|
||||
var depends = _activeManifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<BundleInfo> result = new List<BundleInfo>(depends.Length);
|
||||
List<PackageBundle> depends = _activeManifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<BundleInfo> result = ListPool<BundleInfo>.Get();
|
||||
foreach (var packageBundle in depends)
|
||||
{
|
||||
BundleInfo bundleInfo = CreateBundleInfo(packageBundle);
|
||||
result.Add(bundleInfo);
|
||||
}
|
||||
return result.ToArray();
|
||||
ListPool<PackageBundle>.Release(depends);
|
||||
return result;
|
||||
}
|
||||
string IBundleQuery.GetMainBundleName(AssetInfo assetInfo)
|
||||
{
|
||||
|
@ -297,19 +301,20 @@ namespace YooAsset
|
|||
var packageBundle = _activeManifest.GetMainPackageBundle(assetInfo.AssetPath);
|
||||
return packageBundle.BundleName;
|
||||
}
|
||||
string[] IBundleQuery.GetDependBundleNames(AssetInfo assetInfo)
|
||||
List<string> IBundleQuery.GetDependBundleNames(AssetInfo assetInfo)
|
||||
{
|
||||
if (assetInfo.IsInvalid)
|
||||
throw new Exception("Should never get here !");
|
||||
|
||||
// 注意:如果清单里未找到资源包会抛出异常!
|
||||
var depends = _activeManifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<string> result = new List<string>(depends.Length);
|
||||
List<PackageBundle> depends = _activeManifest.GetAllDependencies(assetInfo.AssetPath);
|
||||
List<string> result = ListPool<string>.Get();
|
||||
foreach (var packageBundle in depends)
|
||||
{
|
||||
result.Add(packageBundle.BundleName);
|
||||
}
|
||||
return result.ToArray();
|
||||
ListPool<PackageBundle>.Release(depends);
|
||||
return result;
|
||||
}
|
||||
bool IBundleQuery.ManifestValid()
|
||||
{
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Diagnostics;
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.Pool;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
|
@ -534,13 +535,13 @@ namespace YooAsset
|
|||
if (bundleInfo.LoadMode == BundleInfo.ELoadMode.LoadFromRemote)
|
||||
return true;
|
||||
|
||||
BundleInfo[] depends = _bundleQuery.GetDependBundleInfos(assetInfo);
|
||||
List<BundleInfo> depends = _bundleQuery.GetDependBundleInfos(assetInfo);
|
||||
foreach (var depend in depends)
|
||||
{
|
||||
if (depend.LoadMode == BundleInfo.ELoadMode.LoadFromRemote)
|
||||
return true;
|
||||
}
|
||||
|
||||
ListPool<BundleInfo>.Release(depends);
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
|
|
Loading…
Reference in New Issue