mirror of https://github.com/axmolengine/axmol.git
Update CCNode.cpp
removeAllChildrenWithCleanup() not remove PhysicsBody
This commit is contained in:
parent
2158a3b013
commit
8b737d8aab
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue