From e92b514624cc362e53ddeae5ade20fa732f94c7c Mon Sep 17 00:00:00 2001 From: Jake O'Connor <131695969+jakeoconnor-peoplefun@users.noreply.github.com> Date: Thu, 27 Apr 2023 16:17:24 -0700 Subject: [PATCH] fix: remove unnecessary per-frame allocation. --- Scripts/UIParticle.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Scripts/UIParticle.cs b/Scripts/UIParticle.cs index f8ecbe5..5753609 100644 --- a/Scripts/UIParticle.cs +++ b/Scripts/UIParticle.cs @@ -323,9 +323,13 @@ namespace Coffee.UIExtensions { if (!isActiveAndEnabled) return; - if (m_Renderers.Any(x => !x)) + foreach (var rend in m_Renderers) { - RefreshParticles(particles); + if (!rend) + { + RefreshParticles(particles); + break; + } } var bakeCamera = GetBakeCamera();