update resource manager

优化ForceUnloadAllAssets方法逻辑
This commit is contained in:
hevinci
2023-10-19 19:39:14 +08:00
parent 194afe435a
commit d30a8aefa4
9 changed files with 82 additions and 32 deletions
@@ -46,6 +46,7 @@ namespace YooAsset
private readonly List<ProviderBase> _providers = new List<ProviderBase>(100);
private readonly List<ProviderBase> _removeList = new List<ProviderBase>(100);
protected bool IsForceDestroyComplete { private set; get; } = false;
internal AssetBundle CacheBundle { set; get; }
internal string FileLoadPath { set; get; }
internal float DownloadProgress { set; get; }
@@ -165,6 +166,18 @@ namespace YooAsset
}
}
/// <summary>
/// 强制销毁资源提供者
/// </summary>
public void ForceDestroyComplete()
{
IsForceDestroyComplete = true;
// 注意:主动轮询更新完成同步加载
// 说明:如果正在下载或解压也可以放心销毁。
Update();
}
/// <summary>
/// 主线程等待异步操作完毕
/// </summary>