From 95202546bb218d7413afb132ea88e79a4145d538 Mon Sep 17 00:00:00 2001 From: mob-sakai Date: Tue, 15 Jan 2019 21:59:27 +0900 Subject: [PATCH] Fix error --- Editor/UIParticleEditor.cs | 2 +- UIParticle.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Editor/UIParticleEditor.cs b/Editor/UIParticleEditor.cs index 5058708..ab30d1c 100644 --- a/Editor/UIParticleEditor.cs +++ b/Editor/UIParticleEditor.cs @@ -143,7 +143,7 @@ namespace Coffee.UIExtensions foreach (UIParticle uip in _particles) { ParticleSystem ps = uip.cachedParticleSystem; - if (!ps) + if (!ps || !uip.canvas) { continue; } diff --git a/UIParticle.cs b/UIParticle.cs index fe3a1a2..537f6ac 100755 --- a/UIParticle.cs +++ b/UIParticle.cs @@ -242,11 +242,11 @@ namespace Coffee.UIExtensions /// static void UpdateMeshes () { - foreach (var uip in s_ActiveParticles) + for (int i = 0; i < s_ActiveParticles.Count; i++) { - if(uip) + if (s_ActiveParticles [i]) { - uip.UpdateMesh (); + s_ActiveParticles [i].UpdateMesh (); } } }