From cc7290f10ef2589bca019910bfdfb1bf645eeb12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E5=86=A0=E5=B3=B0?= Date: Wed, 19 Feb 2025 18:36:33 +0800 Subject: [PATCH] update operation system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 快速启动模式 --- .../Runtime/OperationSystem/OperationSystem.cs | 10 ++++++++++ Assets/YooAsset/Runtime/YooAssets.cs | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/Assets/YooAsset/Runtime/OperationSystem/OperationSystem.cs b/Assets/YooAsset/Runtime/OperationSystem/OperationSystem.cs index ada955e8..34029560 100644 --- a/Assets/YooAsset/Runtime/OperationSystem/OperationSystem.cs +++ b/Assets/YooAsset/Runtime/OperationSystem/OperationSystem.cs @@ -13,6 +13,11 @@ namespace YooAsset private static Stopwatch _watch; private static long _frameTime; + /// + /// 快速启动模式 + /// + public static bool QuickStartMode = false; + /// /// 异步操作的最小时间片段 /// @@ -136,6 +141,11 @@ namespace YooAsset _newList.Add(operation); operation.SetPackageName(packageName); operation.SetStart(); + + if (QuickStartMode) + { + operation.InternalOnUpdate(); + } } } } \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/YooAssets.cs b/Assets/YooAsset/Runtime/YooAssets.cs index cb0f5c7b..276c8e12 100644 --- a/Assets/YooAsset/Runtime/YooAssets.cs +++ b/Assets/YooAsset/Runtime/YooAssets.cs @@ -222,6 +222,15 @@ namespace YooAsset } OperationSystem.MaxTimeSlice = milliseconds; } + + /// + /// 设置异步系统参数,快速启动模式的开关 + /// 注意:该模式默认开启 + /// + public static void SetOperationSystemQuickStartMode(bool state) + { + OperationSystem.QuickStartMode = state; + } #endregion #region 调试信息