From 2a1f3345bacdecf38e8890781a181a1392224e35 Mon Sep 17 00:00:00 2001 From: mob-sakai Date: Tue, 2 Feb 2021 00:38:19 +0900 Subject: [PATCH] fix: submeshes can't over 8 Close #122 --- Scripts/Editor/UIParticleEditor.cs | 13 ------------- Scripts/UIParticle.cs | 9 +-------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/Scripts/Editor/UIParticleEditor.cs b/Scripts/Editor/UIParticleEditor.cs index 24d805d..0fde1f6 100644 --- a/Scripts/Editor/UIParticleEditor.cs +++ b/Scripts/Editor/UIParticleEditor.cs @@ -204,19 +204,6 @@ namespace Coffee.UIExtensions DestroyUIParticle(current); return; } - - current.GetComponentsInParent(true, s_TempParents); - if (FixButton(1 < s_TempParents.Count, "This UIParticle component should be removed. The parent UIParticle exists.")) - { - DestroyUIParticle(current); - return; - } - - current.GetComponentsInChildren(true, s_TempChildren); - if (FixButton(1 < s_TempChildren.Count, "The children UIParticle component should be removed.")) - { - s_TempChildren.ForEach(child => DestroyUIParticle(child, true)); - } } void DestroyUIParticle(UIParticle p, bool ignoreCurrent = false) diff --git a/Scripts/UIParticle.cs b/Scripts/UIParticle.cs index d23da27..9d8609e 100755 --- a/Scripts/UIParticle.cs +++ b/Scripts/UIParticle.cs @@ -222,6 +222,7 @@ namespace Coffee.UIExtensions { if (!root) return; root.GetComponentsInChildren(particles); + particles.RemoveAll(x => x.GetComponentInParent() != this); foreach (var ps in particles) { @@ -447,14 +448,6 @@ namespace Coffee.UIExtensions enabled = false; return; } - else if (enabled && transform.parent && transform.parent.GetComponentInParent()) - { - UnityEngine.Debug.LogWarningFormat(this, "[UIParticle] The UIParticle component should be removed: {0}\nReason: The parent UIParticle exists.", name); - gameObject.hideFlags = HideFlags.None; - _shouldBeRemoved = true; - enabled = false; - return; - } if (!this || particles.AnyFast()) return;