update resource manager
parent
d30a8aefa4
commit
e8b5a58a90
|
@ -116,9 +116,8 @@ namespace YooAsset
|
||||||
return;
|
return;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
_removeList.Clear();
|
|
||||||
|
|
||||||
// 获取移除列表
|
// 获取移除列表
|
||||||
|
_removeList.Clear();
|
||||||
foreach (var provider in _providers)
|
foreach (var provider in _providers)
|
||||||
{
|
{
|
||||||
if (provider.CanDestroy())
|
if (provider.CanDestroy())
|
||||||
|
@ -136,8 +135,6 @@ namespace YooAsset
|
||||||
|
|
||||||
// 移除资源提供者
|
// 移除资源提供者
|
||||||
Impl.RemoveBundleProviders(_removeList);
|
Impl.RemoveBundleProviders(_removeList);
|
||||||
|
|
||||||
_removeList.Clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -199,8 +199,9 @@ namespace YooAsset
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void ReleaseAllHandles()
|
public void ReleaseAllHandles()
|
||||||
{
|
{
|
||||||
foreach (var handle in _handles)
|
for (int i = _handles.Count - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
|
var handle = _handles[i];
|
||||||
handle.ReleaseInternal();
|
handle.ReleaseInternal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,14 @@ namespace YooAsset
|
||||||
private static GameObject _driver = null;
|
private static GameObject _driver = null;
|
||||||
private static readonly List<ResourcePackage> _packages = new List<ResourcePackage>();
|
private static readonly List<ResourcePackage> _packages = new List<ResourcePackage>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否已经初始化
|
||||||
|
/// </summary>
|
||||||
|
public static bool Initialized
|
||||||
|
{
|
||||||
|
get { return _isInitialize; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化资源系统
|
/// 初始化资源系统
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -90,7 +98,7 @@ namespace YooAsset
|
||||||
public static ResourcePackage CreatePackage(string packageName)
|
public static ResourcePackage CreatePackage(string packageName)
|
||||||
{
|
{
|
||||||
CheckException(packageName);
|
CheckException(packageName);
|
||||||
if (HasPackage(packageName))
|
if (ContainsPackage(packageName))
|
||||||
throw new Exception($"Package {packageName} already existed !");
|
throw new Exception($"Package {packageName} already existed !");
|
||||||
|
|
||||||
YooLogger.Log($"Create resource package : {packageName}");
|
YooLogger.Log($"Create resource package : {packageName}");
|
||||||
|
@ -142,7 +150,7 @@ namespace YooAsset
|
||||||
/// 检测资源包是否存在
|
/// 检测资源包是否存在
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="packageName">资源包名称</param>
|
/// <param name="packageName">资源包名称</param>
|
||||||
public static bool HasPackage(string packageName)
|
public static bool ContainsPackage(string packageName)
|
||||||
{
|
{
|
||||||
CheckException(packageName);
|
CheckException(packageName);
|
||||||
var package = GetPackageInternal(packageName);
|
var package = GetPackageInternal(packageName);
|
||||||
|
|
Loading…
Reference in New Issue