コード例 #1
0
        //---------------------------------------------------------------
        #endregion
        //---------------------------------------------------------------

        //---------------------------------------------------------------
        #region Methods
        //---------------------------------------------------------------
        /// <summary>
        /// Attach a scene node to the current node.
        /// </summary>
        /// <param name="node">Node to attach.</param>
        public void Attach(ISceneNode node)
        {
            if (Current != null)
            {
                Current.Attach(node);
            }
            node.Manager = this;
            stack.Add(node);
        }
コード例 #2
0
 /// <summary>
 /// adds a new child scene node
 /// the nodes parent property is set automatically
 /// </summary>
 /// <param name="node">node to add</param>
 /// <returns>the added node</returns>
 public ISceneNode Attach(ISceneNode node)
 {
     if (node.IsAttached())
     {
         throw new GraphicsException("Node is already attached to a root node! Detach first!");
     }
     if (nodes == null)
     {
         nodes = new SceneNodes();
     }
     nodes.Add(node);
     node.Parent  = this;
     node.Manager = Manager;
     return(node);
 }