Axiom.Core.SceneNode.RemoveAndDestroyAllChildren C# (CSharp) Метод

RemoveAndDestroyAllChildren() публичный Метод

Removes and destroys all children in the subtree of this node.
Use this to destroy all nodes found in the child subtree of this node and remove them from the scene graph. Note that all objects attached to the nodes will be detached but will not be destroyed.
public RemoveAndDestroyAllChildren ( ) : void
Результат void
		public virtual void RemoveAndDestroyAllChildren()
		{
			foreach ( SceneNode sn in childNodes.Values )
			{
				sn.RemoveAndDestroyAllChildren();

				// destroy but prevent removing from internal list yet
				this.RemoveChild( sn, false );
				sn.Creator.DestroySceneNode( sn, false );
			}

			// finish removal
			childNodes.Clear();

			NeedUpdate();
		}

Usage Example

Пример #1
0
        /// <summary>
        /// This method removes and destroys the child and all of its children.
        /// </summary>
        /// <param name="sceneNode">The node to remove and destroy</param>
        /// <remarks>
        /// Unlike removeChild, which removes a single named child from this
        /// node but does not destroy it, this method destroys the child
        /// and all of it's children.
        /// <para>
        /// Use this if you wish to recursively destroy a node as well as
        /// detaching it from it's parent. Note that any objects attached to
        /// the nodes will be detached but will not themselves be destroyed.
        /// </para>
        /// </remarks>
        public virtual void RemoveAndDestroyChild(SceneNode sceneNode)
        {
            sceneNode.RemoveAndDestroyAllChildren();

            RemoveChild(sceneNode);
            sceneNode.Creator.DestroySceneNode(sceneNode);
        }
All Usage Examples Of Axiom.Core.SceneNode::RemoveAndDestroyAllChildren