| 1391 | } |
| 1392 | |
| 1393 | void Node::onExit() |
| 1394 | { |
| 1395 | if (_running) |
| 1396 | { |
| 1397 | --__attachedNodeCount; |
| 1398 | } |
| 1399 | |
| 1400 | if (_onExitCallback) |
| 1401 | _onExitCallback(); |
| 1402 | |
| 1403 | if (_componentContainer && !_componentContainer->isEmpty()) |
| 1404 | { |
| 1405 | _componentContainer->onExit(); |
| 1406 | } |
| 1407 | |
| 1408 | this->pause(); |
| 1409 | |
| 1410 | _running = false; |
| 1411 | |
| 1412 | for (const auto& child : _children) |
| 1413 | child->onExit(); |
| 1414 | |
| 1415 | #if AX_ENABLE_SCRIPT_BINDING |
| 1416 | ScriptEngineManager::sendNodeEventToLua(this, kNodeOnExit); |
| 1417 | #endif |
| 1418 | } |
| 1419 | |
| 1420 | void Node::setEventDispatcher(EventDispatcher* dispatcher) |
| 1421 | { |
no test coverage detected