/// <summary> /// Removes a child node from parent node, returns child node, possible issues with how it is detached /// </summary> /// <param name="node">Node you wish to detach</param> /// <returns>Detached node</returns> public SceneNode detachChild(ref SceneNode node) { foreach (SceneNode nodel in mChildren) { if (nodel == node) { nodel.mParent = null; mChildren.Remove(nodel); return nodel; } } return null; }
public void attachChild(SceneNode child) { child.mParent = this; mChildren.Add(child); }
//constructor public SceneNode() { mParent = null; mChildren = new List<SceneNode>(); this.Position = new Vector2f(0, 0); }