// //onEnter & onExit // public virtual void onEnter() { if (_children != null) { for (int i = _children.Count - 1; i >= 0; i--) { CCNode child = _children[i]; child.onEnter(); } } resumeSchedulerAndActions(); _isRunning = true; gameObject.SetActive(_visible); }
/* "add" logic MUST only be on this method * If a class want's to extend the 'addChild' behaviour it only needs * to override this method */ public virtual void addChild(CCNode child, int z, string tag) { NSUtils.Assert(child != null, "Argument must be non-nil"); NSUtils.Assert(child.parent == null, "child already added. It can't be added again"); if (_children == null) { _children = new List <CCNode> (); } insertChild(child, z); child.userTag = tag; child.parent = this; child.orderOfArrival = globalOrderOfArrival++; if (_isRunning) { child.onEnter(); child.onEnterTransitionDidFinish(); } }