【m】yooasset更新
All checks were successful
Plugin Library CI / publish (00.BuildOriginality) (push) Successful in 3s
Plugin Library CI / publish (07.RKTools) (push) Successful in 2s
Plugin Library CI / publish (00.StaryEvo) (push) Successful in 4s
Plugin Library CI / publish (00.StaryEvoTools) (push) Successful in 10s
Plugin Library CI / publish (01.HybridCLR) (push) Successful in 5s
Plugin Library CI / publish (02.InformationSave) (push) Successful in 3s
Plugin Library CI / publish (03.YooAsset) (push) Successful in 1m25s
Plugin Library CI / publish (04.AudioCore) (push) Successful in 4s
Plugin Library CI / publish (05.TableTextConversion) (push) Successful in 4s
Plugin Library CI / publish (06.UIFarme) (push) Successful in 16s
Plugin Library CI / publish (08.UniTask) (push) Successful in 3s
Plugin Library CI / publish (09.CodeChecker) (push) Successful in 16s
Plugin Library CI / publish (10.StoryEditor) (push) Successful in 3s
Plugin Library CI / publish (10.XNode) (push) Successful in 4s
Plugin Library CI / publish (11.PointCloudTools) (push) Successful in 3s

This commit is contained in:
2026-04-13 22:36:57 +08:00
parent cb6a956ac2
commit a7902e8224
572 changed files with 1597 additions and 904 deletions

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0f3b9b0f6eab0144eabc3550a23d1d11
guid: 26dbf3c6610209e40bcf31c9c66739bc
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f6f9946795621e84a83979e2312cb482
guid: 937392854b37d5043808598f2d0e07ec
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 48b9b5872a3ffd34389a3250306ad290
guid: 6de8dc2be5f52704abe6db03818edff2
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3e0d362ea8e7fba4a9cc42b8b1cb7dbd
guid: 6b766125ab790154ca132adb5c77333d
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -23,6 +23,11 @@ namespace YooAsset
if (IsValidWithWarning == false)
return;
Provider.ReleaseHandle(this);
// 主动卸载零引用的资源包
if (Provider.RefCount == 0)
Provider.TryUnloadBundle();
Provider = null;
}
@@ -146,11 +151,11 @@ namespace YooAsset
/// </summary>
public System.Threading.Tasks.Task Task
{
get
get
{
if (IsValidWithWarning == false)
return null;
return Provider.Task;
return Provider.Task;
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 6c932b28d95c0d14cabc0e39551f9a24
guid: a9f5acda1a4584648af7b47e19a0d24f
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ea90f697f83938348b7083daea97dae6
guid: 4d6ef91e069948c48b7ca60be4c218ee
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7aafefcdada7d074ebf598be71ace3e3
guid: e8420ba734d425a4ba9f19173d74503c
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ff0c9ad6b3824ad4a81139409a1ddf60
guid: c5d788ba2dd3c5243ae2e0be8e780825
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 8708f0eefd38ce44daf61682de2a5e74
guid: 76b148be04a698e45a54dd85e64969dd
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 681599ba1ba45784fb21a5fa57b64d40
guid: fcfac83df022948478c32bf11b8e0987
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 1403751481fa7804a8ee1b02f3339562
guid: 8e7d3b16d9b01f548b4654e958d43a37
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 07b0c925de890fb4ebdd6cb04d17332a
guid: dfb81dc2664ed4d4db4bd2b95caadae4
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -173,6 +173,13 @@ namespace YooAsset
if (Result != null)
Result.UnloadBundleFile();
if (IsDone == false)
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = "Bundle loader destroyed !";
}
}
/// <summary>
@@ -180,11 +187,7 @@ namespace YooAsset
/// </summary>
public bool CanDestroyLoader()
{
// 注意:正在加载中的任务不可以销毁
if (_steps == ESteps.LoadBundleFile)
return false;
if (RefCount > 0)
if (CanReleasableLoader() == false)
return false;
// YOOASSET_LEGACY_DEPENDENCY
@@ -194,14 +197,34 @@ namespace YooAsset
{
foreach (var bundleID in LoadBundleInfo.Bundle.ReferenceBundleIDs)
{
#if YOOASSET_EXPERIMENTAL
if (_resManager.CheckBundleReleasable(bundleID) == false)
return false;
#else
if (_resManager.CheckBundleDestroyed(bundleID) == false)
return false;
#endif
}
}
return true;
}
/// <summary>
/// 是否可以释放
/// </summary>
public bool CanReleasableLoader()
{
// 注意:正在加载中的任务不可以销毁
if (_steps == ESteps.LoadBundleFile)
return false;
if (RefCount > 0)
return false;
return true;
}
/// <summary>
/// 添加附属的资源提供者
/// </summary>
@@ -240,5 +263,28 @@ namespace YooAsset
_removeList.Clear();
}
}
/// <summary>
/// 尝试终止加载器
/// </summary>
public void TryAbortLoader()
{
if (IsDone == false)
{
if (_steps == ESteps.CheckConcurrency)
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = "Abort bundle loader !";
}
if (_steps == ESteps.LoadBundleFile)
{
// 注意:终止下载器
if (_loadBundleOp != null)
_loadBundleOp.AbortDownloadFile = true;
}
}
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 4a3adbd84f3eff44abf6608a4218ca86
guid: 031287bf937f83e4fa18a0db797abb42
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -23,7 +23,7 @@ namespace YooAsset
None,
CheckOptions,
ReleaseAll,
AbortDownload,
TryAbortLoader,
CheckLoading,
DestroyAll,
Done,
@@ -78,15 +78,16 @@ namespace YooAsset
}
}
_steps = ESteps.AbortDownload;
_steps = ESteps.TryAbortLoader;
}
if (_steps == ESteps.AbortDownload)
if (_steps == ESteps.TryAbortLoader)
{
// 注意:终止所有载任务
// 尝试终止所有载任务
// 注意正在加载AssetBundle的任务无法终止
foreach (var loader in _resManager.LoaderDic.Values)
{
loader.AbortOperation();
loader.TryAbortLoader();
}
_steps = ESteps.CheckLoading;
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 2ba3258d0a5b3e849b3275824d369494
guid: 97b5f55d30137a4438d3cbed93819c6b
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 6c19ff9ab622c7147ae65df8dac0d58e
guid: 5299512de5ab5c141ae37dac6ee1721e
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: fafa7bf348eb52a48bf263c73097ca88
guid: 90a7cd6101e04ac48ae6aa383572d2c4
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 6e1667a0f86ac644daf457bc79a17e9f
guid: c64025c73372d9d4cab02c9cf9436e55
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3dd83c1bad4a22940bd645a8865c29f8
guid: 33f2d909fd8d9ab4eaedcded2519d1d8
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d250a67a761aa6942aae137d42553541
guid: e6adffc18dc473141ad72e0f5da5dada
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 642d1eeca610f314fb7f7b8ececfac63
guid: 8e64fd2ee771f7d498838ebf375a9531
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -308,6 +308,17 @@ namespace YooAsset
}
}
/// <summary>
/// 尝试卸载资源包
/// </summary>
public void TryUnloadBundle()
{
if (_resManager.AutoUnloadBundleWhenUnused)
{
_resManager.TryUnloadUnusedAsset(MainAssetInfo, 10);
}
}
/// <summary>
/// 结束流程
/// </summary>

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: cedfac76530f4814f923c9be61f5f337
guid: 02cc2ce3da5a88b48942ad96e6061aad
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0d11258f803e7fb42930b4f9c92527b7
guid: 49b6e666518da98479966a5cf0504d59
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: a356301b3e50fdc40a3de57b44f7663f
guid: 8586015105ad65f438e2f2e9c64c3df1
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c5fd993192a4dab49b3bfd5ff12f144d
guid: 0cef140e594c94640abfcd439f6b8be3
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -17,6 +17,7 @@ namespace YooAsset
private int _bundleLoadingMaxConcurrency;
// 开发者配置选项
public bool AutoUnloadBundleWhenUnused { private set; get; }
public bool WebGLForceSyncLoadAsset { private set; get; }
public bool UseWeakReferenceHandle { private set; get; }
@@ -47,6 +48,7 @@ namespace YooAsset
public void Initialize(InitializeParameters parameters, IBundleQuery bundleServices)
{
_bundleLoadingMaxConcurrency = parameters.BundleLoadingMaxConcurrency;
AutoUnloadBundleWhenUnused = parameters.AutoUnloadBundleWhenUnused;
WebGLForceSyncLoadAsset = parameters.WebGLForceSyncLoadAsset;
UseWeakReferenceHandle = parameters.UseWeakReferenceHandle;
_bundleQuery = bundleServices;
@@ -327,6 +329,14 @@ namespace YooAsset
return true;
return bundleFileLoader.IsDestroyed;
}
internal bool CheckBundleReleasable(int bundleID)
{
string bundleName = _bundleQuery.GetMainBundleName(bundleID);
var bundleFileLoader = TryGetBundleFileLoader(bundleName);
if (bundleFileLoader == null)
return true;
return bundleFileLoader.CanReleasableLoader();
}
internal bool HasAnyLoader()
{
return LoaderDic.Count > 0;

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 58ea9519b6ca7cf49a6f6a153cd367ee
guid: 3ecc5913758e8234fbba5ef2fd192f86
MonoImporter:
externalObjects: {}
serializedVersion: 2