diff --git a/Runtime/Container/Runner.Update.Fix.cs b/Runtime/Container/Runner.Update.Fix.cs index 2e6656e..0b4890b 100644 --- a/Runtime/Container/Runner.Update.Fix.cs +++ b/Runtime/Container/Runner.Update.Fix.cs @@ -14,6 +14,8 @@ partial class Runner { #region Nested type: ThreadMono + public static event Action OnFixedUpdate; + partial class ThreadMono { private bool mIsUpdateFixedExe; @@ -33,6 +35,7 @@ private IEnumerator UpdateFixAction() public void FixedUpdate() { + OnFixedUpdate?.Invoke(); if (QueuesDelegateUpdateLateState) return; //判断当前是否有操作正在执行 if (QueuesDelegateUpdateFixed.Count == 0) return; //清空队列中 残留的操作函数 QueuesDelegateUpdateLateState = true; //并开启执行状态 @@ -56,4 +59,4 @@ public void FixedUpdate() #endregion } -} \ No newline at end of file +} diff --git a/Runtime/Container/Runner.Update.Late.cs b/Runtime/Container/Runner.Update.Late.cs index af4fdb4..18ad9b6 100644 --- a/Runtime/Container/Runner.Update.Late.cs +++ b/Runtime/Container/Runner.Update.Late.cs @@ -1,5 +1,6 @@ #region namespace +using System; using System.Collections; #if SUPPORT_UNITASK using Cysharp.Threading.Tasks; @@ -13,6 +14,8 @@ partial class Runner { #region Nested type: ThreadMono + public static event Action OnLateUpdate; + private partial class ThreadMono { private bool mIsUpdateLateExe; @@ -32,6 +35,7 @@ private IEnumerator UpdateLateAction() public void LateUpdate() { + OnLateUpdate?.Invoke(); if (QueuesDelegateUpdateFixedState) return; //判断当前是否有操作正在执行 if (QueuesDelegateUpdateLate.Count == 0) return; //清空队列中 残留的操作函数 QueuesDelegateUpdateFixedState = true; //并开启执行状态 @@ -55,4 +59,4 @@ public void LateUpdate() #endregion } -} \ No newline at end of file +} diff --git a/Runtime/Container/Runner.Update.cs b/Runtime/Container/Runner.Update.cs index 45bde5f..0f954a1 100644 --- a/Runtime/Container/Runner.Update.cs +++ b/Runtime/Container/Runner.Update.cs @@ -1,5 +1,6 @@ #region namespace +using System; using System.Collections; #if SUPPORT_UNITASK using Cysharp.Threading.Tasks; @@ -13,6 +14,8 @@ partial class Runner { #region Nested type: ThreadMono + public static event Action OnUpdate; + partial class ThreadMono { private bool mIsUpdateExe; @@ -44,6 +47,7 @@ private void UpdateQueue() public void Update() { + OnUpdate?.Invoke(); if (!QueuesCoroutineState && !QueuesCoroutine.IsEmpty) UpdateCoroutine(); if (!QueuesDelegateUpdateState && !QueuesDelegateUpdate.IsEmpty) UpdateQueue(); if (!mIsUpdateExe && !QueueCopiedUpdate.IsEmpty) @@ -59,4 +63,4 @@ public void Update() #endregion } -} \ No newline at end of file +}