/// <summary>
 /// Unregisters the specified node from the parent.
 /// </summary>
 /// <param name="fast">Prevents registration from triggering a draw list
 /// update. Meant to be used in conjunction with pooled elements being
 /// unregistered/reregistered to the same parent.</param>
 public virtual bool RemoveChild(HudNodeBase child)
 {
     if (child.Parent == this)
     {
         return(child.Unregister());
     }
     else if (child.Parent == null)
     {
         return(children.Remove(child));
     }
     else
     {
         return(false);
     }
 }
示例#2
0
            public override bool RemoveChild(HudNodeBase child)
            {
                if (child.Parent == this)
                {
                    bool success = child.Unregister();

                    if (success)
                    {
                        RemoveChild(child);
                    }

                    return(success);
                }
                else if (child.Parent == null && children.Remove(child))
                {
                    if (!skipCollectionRemove)
                    {
                        for (int n = 0; n < hudCollectionList.Count; n++)
                        {
                            if (hudCollectionList[n].Element == child)
                            {
                                hudCollectionList.RemoveAt(n);
                                break;
                            }
                        }
                    }
                    else
                    {
                        skipCollectionRemove = false;
                    }

                    return(true);
                }
                else
                {
                    return(false);
                }
            }