update coffee.internal

mob-sakai 2024-06-27 16:26:48 +09:00
parent 86fdcde50a
commit aa2f99ce01
4 changed files with 11 additions and 4 deletions

View File

@ -50,7 +50,7 @@ namespace Coffee.UIParticleInternal
var childCount = tr.childCount; var childCount = tr.childCount;
for (var i = 0; i < childCount; i++) for (var i = 0; i < childCount; i++)
{ {
tr.GetChild(i).GetComponentsInChildren(results, depth - 1); tr.GetChild(i).GetComponentsInChildren_Internal(results, depth - 1);
} }
} }

View File

@ -20,6 +20,7 @@ namespace Coffee.UIParticleInternal
/// </summary> /// </summary>
public void Add(T rhs) public void Add(T rhs)
{ {
if (rhs == null) return;
Profiler.BeginSample("(COF)[FastAction] Add Action"); Profiler.BeginSample("(COF)[FastAction] Add Action");
var node = s_NodePool.Rent(); var node = s_NodePool.Rent();
node.Value = rhs; node.Value = rhs;
@ -32,6 +33,7 @@ namespace Coffee.UIParticleInternal
/// </summary> /// </summary>
public void Remove(T rhs) public void Remove(T rhs)
{ {
if (rhs == null) return;
Profiler.BeginSample("(COF)[FastAction] Remove Action"); Profiler.BeginSample("(COF)[FastAction] Remove Action");
var node = _delegates.Find(rhs); var node = _delegates.Find(rhs);
if (node != null) if (node != null)
@ -63,6 +65,11 @@ namespace Coffee.UIParticleInternal
node = node.Next; node = node.Next;
} }
} }
public void Clear()
{
_delegates.Clear();
}
} }
/// <summary> /// <summary>

View File

@ -5,7 +5,6 @@ using Object = UnityEngine.Object;
#if ENABLE_COFFEE_LOGGER #if ENABLE_COFFEE_LOGGER
using System.Reflection; using System.Reflection;
using System.Collections.Generic; using System.Collections.Generic;
#else #else
using Conditional = System.Diagnostics.ConditionalAttribute; using Conditional = System.Diagnostics.ConditionalAttribute;
#endif #endif

View File

@ -64,11 +64,12 @@ namespace Coffee.UIParticleInternal
#if UNITY_EDITOR #if UNITY_EDITOR
[InitializeOnLoadMethod] [InitializeOnLoadMethod]
#else
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
#endif #endif
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
private static void InitializeOnLoad() private static void InitializeOnLoad()
{ {
Canvas.willRenderCanvases -= OnAfterCanvasRebuild;
s_IsInitializedAfterCanvasRebuild = false;
} }
/// <summary> /// <summary>