/// <summary> /// Adds a child to the container with z order and tag /// If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately. /// </summary> public virtual void AddChild(Node child, int zOrder, int tag) { if (child == null) { throw (new ArgumentNullException("child", "Child can not be null.")); } if (child.Parent != null) { Debug.WriteLine("child in addChild is already added. Child tag=" + tag + ", parent=" + child.Parent.Tag); return; } this._insertChild(child, zOrder); child.Tag = tag; child.Parent = this; if (this.IsRunning) { child.onEnter(); child.onEnterTransitionDidFinish(); } }