Update CCNode.cpp

removeAllChildrenWithCleanup() not remove PhysicsBody
This commit is contained in:
黄梦龙 2014-03-08 17:42:35 +08:00
parent 2158a3b013
commit 8b737d8aab
1 changed files with 7 additions and 0 deletions

View File

@ -836,6 +836,13 @@ void Node::removeAllChildrenWithCleanup(bool cleanup)
child->onExit();
}
#if CC_USE_PHYSICS
if (child->_physicsBody != nullptr)
{
child->_physicsBody->removeFromWorld();
}
#endif
if (cleanup)
{
child->cleanup();