Update PatchSystem

增加清理缓存资源的异步操作类
This commit is contained in:
hevinci
2022-09-06 18:19:50 +08:00
parent f112f18723
commit 3f518ec321
5 changed files with 167 additions and 13 deletions
@@ -13,6 +13,17 @@ namespace YooAsset
private static long _maxTimeSlice;
private static long _frameTime;
/// <summary>
/// 处理器是否繁忙
/// </summary>
public static bool IsBusy
{
get
{
return _watch.ElapsedMilliseconds - _frameTime >= _maxTimeSlice;
}
}
/// <summary>
/// 初始化异步操作系统
@@ -32,7 +43,7 @@ namespace YooAsset
for (int i = _operations.Count - 1; i >= 0; i--)
{
if (_watch.ElapsedMilliseconds - _frameTime >= _maxTimeSlice)
if (IsBusy)
return;
var operation = _operations[i];