From aa2f99ce0114acb20e86cdee3b6b4ef6eb3f8197 Mon Sep 17 00:00:00 2001 From: mob-sakai <12690315+mob-sakai@users.noreply.github.com> Date: Thu, 27 Jun 2024 16:26:48 +0900 Subject: [PATCH] update coffee.internal --- .../src/Runtime/Internal/Extensions/ComponentExtensions.cs | 2 +- Packages/src/Runtime/Internal/Utilities/FastAction.cs | 7 +++++++ Packages/src/Runtime/Internal/Utilities/Logging.cs | 1 - .../src/Runtime/Internal/Utilities/UIExtraCallbacks.cs | 5 +++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Packages/src/Runtime/Internal/Extensions/ComponentExtensions.cs b/Packages/src/Runtime/Internal/Extensions/ComponentExtensions.cs index 255ef6b..b45f016 100644 --- a/Packages/src/Runtime/Internal/Extensions/ComponentExtensions.cs +++ b/Packages/src/Runtime/Internal/Extensions/ComponentExtensions.cs @@ -50,7 +50,7 @@ namespace Coffee.UIParticleInternal var childCount = tr.childCount; for (var i = 0; i < childCount; i++) { - tr.GetChild(i).GetComponentsInChildren(results, depth - 1); + tr.GetChild(i).GetComponentsInChildren_Internal(results, depth - 1); } } diff --git a/Packages/src/Runtime/Internal/Utilities/FastAction.cs b/Packages/src/Runtime/Internal/Utilities/FastAction.cs index 4d389a5..0428d6d 100755 --- a/Packages/src/Runtime/Internal/Utilities/FastAction.cs +++ b/Packages/src/Runtime/Internal/Utilities/FastAction.cs @@ -20,6 +20,7 @@ namespace Coffee.UIParticleInternal /// public void Add(T rhs) { + if (rhs == null) return; Profiler.BeginSample("(COF)[FastAction] Add Action"); var node = s_NodePool.Rent(); node.Value = rhs; @@ -32,6 +33,7 @@ namespace Coffee.UIParticleInternal /// public void Remove(T rhs) { + if (rhs == null) return; Profiler.BeginSample("(COF)[FastAction] Remove Action"); var node = _delegates.Find(rhs); if (node != null) @@ -63,6 +65,11 @@ namespace Coffee.UIParticleInternal node = node.Next; } } + + public void Clear() + { + _delegates.Clear(); + } } /// diff --git a/Packages/src/Runtime/Internal/Utilities/Logging.cs b/Packages/src/Runtime/Internal/Utilities/Logging.cs index d9a2f5e..feee1be 100644 --- a/Packages/src/Runtime/Internal/Utilities/Logging.cs +++ b/Packages/src/Runtime/Internal/Utilities/Logging.cs @@ -5,7 +5,6 @@ using Object = UnityEngine.Object; #if ENABLE_COFFEE_LOGGER using System.Reflection; using System.Collections.Generic; - #else using Conditional = System.Diagnostics.ConditionalAttribute; #endif diff --git a/Packages/src/Runtime/Internal/Utilities/UIExtraCallbacks.cs b/Packages/src/Runtime/Internal/Utilities/UIExtraCallbacks.cs index d62d56b..be9e7ee 100755 --- a/Packages/src/Runtime/Internal/Utilities/UIExtraCallbacks.cs +++ b/Packages/src/Runtime/Internal/Utilities/UIExtraCallbacks.cs @@ -64,11 +64,12 @@ namespace Coffee.UIParticleInternal #if UNITY_EDITOR [InitializeOnLoadMethod] -#else - [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] #endif + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] private static void InitializeOnLoad() { + Canvas.willRenderCanvases -= OnAfterCanvasRebuild; + s_IsInitializedAfterCanvasRebuild = false; } ///