Esempio n. 1
0
void Node::onExit()
{
#if CC_ENABLE_SCRIPT_BINDING
    if (_scriptType == kScriptTypeJavascript)
    {
        if (ScriptEngineManager::sendNodeEventToJS(this, kNodeOnExit))
            return;
    }
#endif

    if (_onExitCallback)
        _onExitCallback();

    if (_componentContainer && !_componentContainer->isEmpty())
    {
        _componentContainer->onExit();
    }

    this->pause();

    _running = false;

    for( const auto &child: _children)
        child->onExit();

#if CC_ENABLE_SCRIPT_BINDING
    if (_scriptType == kScriptTypeLua)
    {
        ScriptEngineManager::sendNodeEventToLua(this, kNodeOnExit);
    }
#endif
}
Esempio n. 2
0
void Node::onExit()
{
    if (_onExitCallback)
        _onExitCallback();
    
    _running = false;
    
    for( const auto &child: _children)
        child->onExit();
}