parent
c0aa89bd6f
commit
2a1f3345ba
|
@ -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)
|
||||
|
|
|
@ -222,6 +222,7 @@ namespace Coffee.UIExtensions
|
|||
{
|
||||
if (!root) return;
|
||||
root.GetComponentsInChildren(particles);
|
||||
particles.RemoveAll(x => x.GetComponentInParent<UIParticle>() != this);
|
||||
|
||||
foreach (var ps in particles)
|
||||
{
|
||||
|
@ -447,14 +448,6 @@ namespace Coffee.UIExtensions
|
|||
enabled = false;
|
||||
return;
|
||||
}
|
||||
else if (enabled && transform.parent && transform.parent.GetComponentInParent<UIParticle>())
|
||||
{
|
||||
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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue