public void RemoveAllChildren()
{
int childCount = _childNodes.Count;
for(int c = 0; c<childCount; c++)
{
FNode node = _childNodes[c];
node.HandleRemovedFromContainer();
if(_isOnStage)
{
node.HandleRemovedFromStage();
node.stage = null;
}
}
_childNodes.Clear();
}
public void clearMe() { background.RemoveAllChildren(); foreground.RemoveAllChildren(); midground.RemoveAllChildren(); enemies.Clear(); humans.Clear(); foreach (FSprite tentacle in tentaclePieces) { tentacle.RemoveFromContainer(); } tentaclePieces.Clear(); foreach (FSprite debug in debugRects.Values) { debug.RemoveFromContainer(); } debugRects.Clear(); }