osu.Framework/Graphics/Containers/CompositeDrawable.cs
/// <summary>
/// Removes a given child from this <see cref="InternalChildren"/>.
/// </summary>
/// <param name="drawable">The <see cref="Drawable"/> to be removed.</param>
/// <returns>False if <paramref name="drawable"/> was not a child of this <see cref="CompositeDrawable"/> and true otherwise.</returns>
Removes a given child from this .
Removes a given child from this .
protected internal virtual bool RemoveInternal(Drawable drawable)
        {
            ensureChildMutationAllowed();
            if (drawable == null)
                throw new ArgumentNullException(nameof(drawable));
            int index = IndexOfInternal(drawable);
            if (index < 0)
                return false;
            internalChildren.RemoveAt(index);
            if (drawable.IsAlive)
            {
                aliveInternalChildren.Remove(drawable);
                ChildDied?.Invoke(drawable);
            }
            if (drawable.LoadState >= LoadState.Ready && drawable.Parent != this)
                throw new InvalidOperationException($@"Removed a drawable ({drawable}) whose parent was not this ({this}), but {drawable.Parent}.");
            drawable.Parent = null;
            drawable.IsAlive = false;
            if (AutoSizeAxes != Axes.None)
                InvalidateFromChild(Invalidation.RequiredParentSizeToFit, drawable);
            return true;
        }
protected internal virtual bool RemoveInternal ( Drawable drawable ) { ensureChildMutationAllowed ( ) ; if ( drawable == null ) throw new ArgumentNullException ( nameof ( drawable ) ) ; int index = IndexOfInternal ( drawable ) ; if ( index < 0 ) return false ; internalChildren . RemoveAt ( index ) ; if ( drawable . IsAlive ) { aliveInternalChildren . Remove ( drawable ) ; ChildDied ? . Invoke ( drawable ) ; } if ( drawable . LoadState >= LoadState . Ready && drawable . Parent != this ) throw new InvalidOperationException ( $@" Removed a drawable ( { drawable } ) whose parent was not this ( { this } ), but  { drawable . Parent } . " ) ; drawable . Parent = null ; drawable . IsAlive = false ; if ( AutoSizeAxes != Axes . None ) InvalidateFromChild ( Invalidation . RequiredParentSizeToFit , drawable ) ; return true ; }
Removes a given child from this .
Removes a given child from this .
False if  was not a child of this  and true otherwise.
False if was not a child of this and true otherwise .
drawable
Drawable
The  to be removed.
The to be removed .