fix: Support for skipping "reload domain"

close #406
This commit is contained in:
mob-sakai
2026-06-24 18:57:55 +09:00
parent 9b3ee547e3
commit b7bb1124f6
7 changed files with 62 additions and 30 deletions

View File

@@ -8,19 +8,19 @@ namespace Coffee.UIParticleInternal
{
private static readonly Dictionary<Type, IFrameCache> s_Caches = new Dictionary<Type, IFrameCache>();
static FrameCache()
{
s_Caches.Clear();
UIExtraCallbacks.onLateAfterCanvasRebuild += ClearAllCache;
}
#if UNITY_EDITOR && UNITY_2019_3_OR_NEWER
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
#elif UNITY_EDITOR
[InitializeOnLoadMethod]
#else
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
#endif
private static void Clear()
{
s_Caches.Clear();
UIExtraCallbacks.onLateAfterCanvasRebuild -= ClearAllCache;
UIExtraCallbacks.onLateAfterCanvasRebuild += ClearAllCache;
}
#endif
/// <summary>
/// Tries to retrieve a value from the frame cache with a specified key.