BBGamelib.CCNode.cleanup C# (CSharp) Method

cleanup() public method

public cleanup ( ) : void
return void
		public virtual void cleanup()
		{
			// actions
			stopAllActions ();
			unscheduleAllSelectors ();
			
			// timers
			if (_children != null) {

				var enumerator = _children.GetEnumerator();
				while (enumerator.MoveNext()) {
					CCNode child = enumerator.Current;
					child.cleanup ();
				}
				_parent = null;
				_children.Clear ();
			}
			recycleGear ();
		}

Usage Example

        void detachChild(CCNode child, bool cleanup)
        {
            // IMPORTANT:
            //  -1st do onExit
            //  -2nd cleanup
            if (_isRunning)
            {
                child.onExitTransitionDidStart();
                child.onExit();
            }

            child.parent = null;
            _children.Remove(child);


            // If you don't do cleanup, the child's actions will not get removed and the
            // its scheduledSelectors_ dict will not get released!
            if (cleanup)
            {
                child.cleanup();
            }
            else
            {
                child.gameObject.SetActive(false);
            }
        }
All Usage Examples Of BBGamelib.CCNode::cleanup