本文整理汇总了C++中CCScene::onExit方法的典型用法代码示例。如果您正苦于以下问题:C++ CCScene::onExit方法的具体用法?C++ CCScene::onExit怎么用?C++ CCScene::onExit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCScene
的用法示例。
在下文中一共展示了CCScene::onExit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: popToRootScene
void CCDirector::popToRootScene(void)
{
CCAssert(m_pRunningScene != NULL, "A running Scene is needed");
unsigned int c = m_pobScenesStack->count();
if (c == 1)
{
m_pobScenesStack->removeLastObject();
this->end();
}
else
{
while (c > 1)
{
CCScene *current = (CCScene*)m_pobScenesStack->lastObject();
if( current->isRunning() )
{
current->onExitTransitionDidStart();
current->onExit();
}
current->cleanup();
m_pobScenesStack->removeLastObject();
c--;
}
m_pNextScene = (CCScene*)m_pobScenesStack->lastObject();
m_bSendCleanupToScene = false;
}
}
示例2: popToSceneStackLevel
void CCDirector::popToSceneStackLevel(int level)
{
CCAssert(m_pRunningScene != NULL, "A running Scene is needed");
int c = (int)m_pobScenesStack->count();
// level 0? -> end
if (level == 0)
{
end();
return;
}
// current level or lower -> nothing
if (level >= c)
return;
// pop stack until reaching desired level
while (c > level)
{
CCScene *current = (CCScene*)m_pobScenesStack->lastObject();
if (current->isRunning())
{
current->onExitTransitionDidStart();
current->onExit();
}
current->cleanup();
m_pobScenesStack->removeLastObject();
c--;
}
m_pNextScene = (CCScene*)m_pobScenesStack->lastObject();
m_bSendCleanupToScene = false;
}