本文整理汇总了C++中CCNode::setCustObject方法的典型用法代码示例。如果您正苦于以下问题:C++ CCNode::setCustObject方法的具体用法?C++ CCNode::setCustObject怎么用?C++ CCNode::setCustObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCNode
的用法示例。
在下文中一共展示了CCNode::setCustObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readNodeGraphFromData
CCNode* CCBReader::readNodeGraphFromData(CCData *pData, CCObject *pOwner, const CCSize &parentSize)
{
mData = pData;
CC_SAFE_RETAIN(mData);
mBytes = mData->getBytes();
mCurrentByte = 0;
mCurrentBit = 0;
mOwner = pOwner;
CC_SAFE_RETAIN(mOwner);
mActionManager->setRootContainerSize(parentSize);
mActionManager->mOwner = mOwner;
CCDictionary* animationManagers = CCDictionary::create();
CCNode *pNodeGraph = readFileWithCleanUp(true, animationManagers);
if (pNodeGraph && mActionManager->getAutoPlaySequenceId() != -1 && !jsControlled)
{
// Auto play animations
mActionManager->runAnimationsForSequenceIdTweenDuration(mActionManager->getAutoPlaySequenceId(), 0);
}
// Assign actionManagers to userObject
if(jsControlled) {
mNodesWithAnimationManagers = new CCArray();
mAnimationManagersForNodes = new CCArray();
}
CCDictElement* pElement = NULL;
CCDICT_FOREACH(animationManagers, pElement)
{
CCNode* pNode = (CCNode*)pElement->getIntKey();
CCBAnimationManager* manager = (CCBAnimationManager*)animationManagers->objectForKey((intptr_t)pNode);
// (jason_shi): 将未命名的JSController命名为路径名
if (manager->getDocumentControllerName().compare("") == 0)
{
CCString* pStr = dynamic_cast<CCString*>(pNode->getCustObject());
if (pStr)
{
manager->setDocumentControllerName(pStr->getCString());
pNode->setCustObject(nullptr);
}
}
pNode->setUserObject(manager);
if (jsControlled)
{
mNodesWithAnimationManagers->addObject(pNode);
mAnimationManagersForNodes->addObject(manager);
}
}