void CCNode::addChild(CCNode *child, int zOrder, int tag)
{
CCAssert( child != NULL, "Argument must be non-nil");
CCAssert( child->m_pParent == NULL, "child already added. It can't be added again");
if( ! m_pChildren )
{
this->childrenAlloc();
}
this->insertChild(child, zOrder);
child->m_nTag = tag;
child->setParent(this);
if( m_bIsRunning )
{
child->onEnter();
child->onEnterTransitionDidFinish();
}
}
看了代码就一目了然,然来只要加载他的对象在跑,那他就立即执行
cocos的cclayer有onEnter()方法,这个在啥时候执行啊?
最新推荐文章于 2017-12-19 14:33:24 发布