template<class T>
void gFindChildByTags(CCNode* pRoot, T& tar, ...)
{
CCNode* pRet = pRoot;
int tag = 0;
va_list arg;
va_start(arg, tar);
while ((tag = va_arg(arg, int)) > 0 && pRet)
{
pRet = pRet->getChildByTag(tag);
}
va_end(arg);
if (pRet != pRoot)
tar = (T)pRet;
else
tar = 0;
}
模版获取多层次节点(使用不定参数)
最新推荐文章于 2024-11-27 12:20:56 发布
