mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-22 16:50:18 +00:00
update resource manager
初始化参数增加AutoDestroyAssetProvider
This commit is contained in:
@@ -20,6 +20,7 @@ namespace YooAsset
|
||||
|
||||
|
||||
private bool _simulationOnEditor;
|
||||
private bool _autoDestroyAssetProvider;
|
||||
private long _loadingMaxTimeSlice;
|
||||
private IBundleQuery _bundleQuery;
|
||||
private bool _isUnloadSafe = true;
|
||||
@@ -49,9 +50,10 @@ namespace YooAsset
|
||||
/// <summary>
|
||||
/// 初始化
|
||||
/// </summary>
|
||||
public void Initialize(bool simulationOnEditor, long loadingMaxTimeSlice, IBundleQuery bundleServices)
|
||||
public void Initialize(bool simulationOnEditor, bool autoDestroyAssetProvider, long loadingMaxTimeSlice, IBundleQuery bundleServices)
|
||||
{
|
||||
_simulationOnEditor = simulationOnEditor;
|
||||
_autoDestroyAssetProvider = autoDestroyAssetProvider;
|
||||
_loadingMaxTimeSlice = loadingMaxTimeSlice;
|
||||
_bundleQuery = bundleServices;
|
||||
_watch = Stopwatch.StartNew();
|
||||
@@ -68,6 +70,9 @@ namespace YooAsset
|
||||
foreach (var loader in _loaderList)
|
||||
{
|
||||
loader.Update();
|
||||
|
||||
if (_autoDestroyAssetProvider)
|
||||
loader.TryDestroyProviders();
|
||||
}
|
||||
|
||||
// 更新资源提供者
|
||||
|
||||
Reference in New Issue
Block a user