CCNode의 addChild()를 살펴보면


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);

    child->setOrderOfArrival(s_globalOrderOfArrival++);


    if( m_bIsRunning )

    {

        child->onEnter();

        child->onEnterTransitionDidFinish();

    }

}


child노드의 onEnter()를 호출한다.



Posted by Нуеоп