From 5a1e65ec566a1a3a35cfbe2e1150266eee2ac51c Mon Sep 17 00:00:00 2001 From: mob-sakai <12690315+mob-sakai@users.noreply.github.com> Date: Tue, 18 Jun 2024 17:11:14 +0900 Subject: [PATCH] refactor: refactor --- Packages/src/Runtime/UIParticleUpdater.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Packages/src/Runtime/UIParticleUpdater.cs b/Packages/src/Runtime/UIParticleUpdater.cs index f316a7e..7437766 100644 --- a/Packages/src/Runtime/UIParticleUpdater.cs +++ b/Packages/src/Runtime/UIParticleUpdater.cs @@ -57,9 +57,8 @@ namespace Coffee.UIExtensions for (var i = 0; i < s_ActiveParticles.Count; i++) { var uip = s_ActiveParticles[i]; - if (!uip || !uip.canvas || !uip.isPrimary || s_UpdatedGroupIds.Contains(uip.groupId)) continue; + if (!uip || !uip.canvas || !uip.isPrimary || !s_UpdatedGroupIds.Add(uip.groupId)) continue; - s_UpdatedGroupIds.Add(uip.groupId); uip.UpdateTransformScale(); uip.UpdateRenderers(); } @@ -76,9 +75,8 @@ namespace Coffee.UIExtensions { uip.UpdateRenderers(); } - else if (!s_UpdatedGroupIds.Contains(uip.groupId)) + else if (s_UpdatedGroupIds.Add(uip.groupId)) { - s_UpdatedGroupIds.Add(uip.groupId); uip.UpdateRenderers(); } }