更新YooAsset 2.3.3 -> 2.3.7 优化YooAsset.RuntimeExtension以及YooAsset.EditorExtension目录结构

更新YooAsset 2.3.3 -> 2.3.7 优化YooAsset.RuntimeExtension以及YooAsset.EditorExtension目录结构
This commit is contained in:
Alex-Rachel
2025-04-17 12:59:23 +08:00
parent 32418326b1
commit 227283864f
206 changed files with 1641 additions and 461 deletions

View File

@@ -9,7 +9,8 @@ namespace YooAsset
private enum ESteps
{
None,
LoadFile,
CheckConcurrency,
LoadBundleFile,
Done,
}
@@ -57,17 +58,32 @@ namespace YooAsset
}
internal override void InternalStart()
{
_steps = ESteps.LoadFile;
_steps = ESteps.CheckConcurrency;
}
internal override void InternalUpdate()
{
if (_steps == ESteps.None || _steps == ESteps.Done)
return;
if (_steps == ESteps.LoadFile)
if (_steps == ESteps.CheckConcurrency)
{
if (IsWaitForAsyncComplete)
{
_steps = ESteps.LoadBundleFile;
}
else
{
if (_resourceManager.BundleLoadingIsBusy())
return;
_steps = ESteps.LoadBundleFile;
}
}
if (_steps == ESteps.LoadBundleFile)
{
if (_loadBundleOp == null)
{
_resourceManager.BundleLoadingCounter++;
_loadBundleOp = LoadBundleInfo.LoadBundleFile();
_loadBundleOp.StartOperation();
AddChildOperation(_loadBundleOp);
@@ -103,6 +119,9 @@ namespace YooAsset
Status = EOperationStatus.Failed;
Error = _loadBundleOp.Error;
}
// 统计计数减少
_resourceManager.BundleLoadingCounter--;
}
}
internal override void InternalWaitForAsyncComplete()

View File

@@ -15,6 +15,7 @@ namespace YooAsset
private readonly ResourceManager _resManager;
private readonly int _loopCount;
private int _loopCounter = 0;
private ESteps _steps = ESteps.None;
internal UnloadUnusedAssetsOperation(ResourceManager resourceManager, int loopCount)
@@ -25,6 +26,7 @@ namespace YooAsset
internal override void InternalStart()
{
_steps = ESteps.UnloadUnused;
_loopCounter = _loopCount;
}
internal override void InternalUpdate()
{
@@ -33,13 +35,23 @@ namespace YooAsset
if (_steps == ESteps.UnloadUnused)
{
for (int i = 0; i < _loopCount; i++)
while (_loopCounter > 0)
{
_loopCounter--;
LoopUnloadUnused();
if (IsWaitForAsyncComplete == false)
{
if (OperationSystem.IsBusy)
break;
}
}
_steps = ESteps.Done;
Status = EOperationStatus.Succeed;
if (_loopCounter <= 0)
{
_steps = ESteps.Done;
Status = EOperationStatus.Succeed;
}
}
}
internal override void InternalWaitForAsyncComplete()