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