diff --git a/Runtime/Internal/Extensions/ComponentExtensions.cs b/Runtime/Internal/Extensions/ComponentExtensions.cs index 255ef6b..b45f016 100644 --- a/Runtime/Internal/Extensions/ComponentExtensions.cs +++ b/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/Runtime/Internal/Utilities/FastAction.cs b/Runtime/Internal/Utilities/FastAction.cs index 4d389a5..0428d6d 100755 --- a/Runtime/Internal/Utilities/FastAction.cs +++ b/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/Runtime/Internal/Utilities/Logging.cs b/Runtime/Internal/Utilities/Logging.cs index d9a2f5e..feee1be 100644 --- a/Runtime/Internal/Utilities/Logging.cs +++ b/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/Runtime/Internal/Utilities/UIExtraCallbacks.cs b/Runtime/Internal/Utilities/UIExtraCallbacks.cs index d62d56b..be9e7ee 100755 --- a/Runtime/Internal/Utilities/UIExtraCallbacks.cs +++ b/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; } ///