cocos3 开篇helloworld

#define CREATE_FUNC(__TYPE__) \
static __TYPE__* create() \
{ \
    __TYPE__ *pRet = new __TYPE__(); \
    if (pRet && pRet->init()) \
    { \
        pRet->autorelease(); \
        return pRet; \
    } \
    else \
    { \
        delete pRet; \
        pRet = NULL; \
        return NULL; \
    } \
}

 

 

摁f12是一个很好的习惯,转到定义出,发现限制性init()方法。所以我们一般认为init()函数是创建的时候执行的方法。

posted @ 2014-11-25 21:01  yufenghou  阅读(113)  评论(0编辑  收藏  举报