removeAllChildren method

void removeAllChildren()

Removes all children of this node.

removeAllChildren();

Implementation

void removeAllChildren() {
  for (Node child in _children) {
    child._parent = null;
    child._spriteBox = null;
  }
  _children = <Node>[];
  _childrenNeedSorting = false;
  if (_spriteBox != null) _spriteBox!._deregisterNode(null);
}