mirror of https://github.com/axmolengine/axmol.git
Adding ScriptingEngine callback for onCleanup event
This commit is contained in:
parent
0d43d53eb7
commit
16d5659b17
|
@ -456,8 +456,13 @@ void CCNode::cleanup()
|
|||
{
|
||||
// actions
|
||||
this->stopAllActions();
|
||||
this->unscheduleAllSelectors();
|
||||
|
||||
this->unscheduleAllSelectors();
|
||||
|
||||
if ( m_eScriptType != kScriptTypeNone)
|
||||
{
|
||||
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeNodeEvent(this, kCCNodeOnCleanup);
|
||||
}
|
||||
|
||||
// timers
|
||||
arrayMakeObjectsPerformSelector(m_pChildren, cleanup, CCNode*);
|
||||
}
|
||||
|
@ -838,6 +843,8 @@ void CCNode::onExit()
|
|||
}
|
||||
|
||||
arrayMakeObjectsPerformSelector(m_pChildren, onExit, CCNode*);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void CCNode::registerScriptHandler(int nHandler)
|
||||
|
|
|
@ -62,7 +62,8 @@ enum {
|
|||
kCCNodeOnEnter,
|
||||
kCCNodeOnExit,
|
||||
kCCNodeOnEnterTransitionDidFinish,
|
||||
kCCNodeOnExitTransitionDidStart
|
||||
kCCNodeOnExitTransitionDidStart,
|
||||
kCCNodeOnCleanup
|
||||
};
|
||||
|
||||
/** @brief CCNode is the main element. Anything that gets drawn or contains things that get drawn is a CCNode.
|
||||
|
|
Loading…
Reference in New Issue