本文整理汇总了C++中ActionNode::setUnitTime方法的典型用法代码示例。如果您正苦于以下问题:C++ ActionNode::setUnitTime方法的具体用法?C++ ActionNode::setUnitTime怎么用?C++ ActionNode::setUnitTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionNode
的用法示例。
在下文中一共展示了ActionNode::setUnitTime方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setUnitTime
void ActionObject::setUnitTime(float fTime)
{
_fUnitTime = fTime;
int nodeNum = _actionNodeList->count();
for ( int i = 0; i < nodeNum; i++ )
{
ActionNode* actionNode = (ActionNode*)_actionNodeList->getObjectAtIndex(i);
actionNode->setUnitTime(_fUnitTime);
}
}
示例2: setUnitTime
void ActionObject::setUnitTime(float fTime)
{
m_fUnitTime = fTime;
int frameNum = m_ActionNodeList->count();
for ( int i = 0; i < frameNum; i++ )
{
ActionNode* actionNode = (ActionNode*)m_ActionNodeList->objectAtIndex(i);
actionNode->setUnitTime(m_fUnitTime);
}
}
示例3: initWithDictionary
void ActionObject::initWithDictionary(JsonDictionary *dic,Object* root)
{
setName(DICTOOL->getStringValue_json(dic, "name"));
setLoop(DICTOOL->getBooleanValue_json(dic, "loop"));
setUnitTime(DICTOOL->getFloatValue_json(dic, "unittime"));
int actionNodeCount = DICTOOL->getArrayCount_json(dic, "actionnodelist");
for (int i=0; i<actionNodeCount; i++) {
ActionNode* actionNode = new ActionNode();
actionNode->autorelease();
JsonDictionary* actionNodeDic = DICTOOL->getDictionaryFromArray_json(dic, "actionnodelist", i);
actionNode->initWithDictionary(actionNodeDic,root);
actionNode->setUnitTime(getUnitTime());
_actionNodeList->addObject(actionNode);
CC_SAFE_DELETE(actionNodeDic);
}
}
示例4: initWithBinary
void ActionObject::initWithBinary(CocoLoader *cocoLoader,
stExpCocoNode *cocoNode,
cocos2d::Ref *root)
{
stExpCocoNode *stChildNode = cocoNode->GetChildArray(cocoLoader);
stExpCocoNode *actionNodeList = nullptr;
int count = cocoNode->GetChildNum();
for (int i = 0; i < count; ++i) {
std::string key = stChildNode[i].GetName(cocoLoader);
std::string value = stChildNode[i].GetValue(cocoLoader);
if (key == "name") {
setName(value.c_str());
}else if (key == "loop"){
setLoop(valueToBool(value));
}else if(key == "unittime"){
setUnitTime(valueToFloat(value));
}else if (key == "actionnodelist"){
actionNodeList = &stChildNode[i];
}
}
if(nullptr != actionNodeList)
{
int actionNodeCount = actionNodeList->GetChildNum();
stExpCocoNode *actionNodeArray = actionNodeList->GetChildArray(cocoLoader);
int maxLength = 0;
for (int i=0; i<actionNodeCount; i++) {
ActionNode* actionNode = new ActionNode();
actionNode->autorelease();
actionNode->initWithBinary(cocoLoader, &actionNodeArray[i] , root);
actionNode->setUnitTime(getUnitTime());
_actionNodeList.pushBack(actionNode);
int length = actionNode->getLastFrameIndex() - actionNode->getFirstFrameIndex();
if(length > maxLength)
maxLength = length;
}
_fTotalTime = maxLength* _fUnitTime;
}
}
示例5: initWithDictionary
void ActionObject::initWithDictionary(const rapidjson::Value& dic, Ref* root)
{
setName(DICTOOL->getStringValue_json(dic, "name"));
setLoop(DICTOOL->getBooleanValue_json(dic, "loop"));
setUnitTime(DICTOOL->getFloatValue_json(dic, "unittime"));
int actionNodeCount = DICTOOL->getArrayCount_json(dic, "actionnodelist");
int maxLength = 0;
for (int i=0; i<actionNodeCount; i++) {
ActionNode* actionNode = new ActionNode();
actionNode->autorelease();
const rapidjson::Value& actionNodeDic = DICTOOL->getDictionaryFromArray_json(dic, "actionnodelist", i);
actionNode->initWithDictionary(actionNodeDic,root);
actionNode->setUnitTime(getUnitTime());
_actionNodeList.pushBack(actionNode);
int length = actionNode->getLastFrameIndex() - actionNode->getFirstFrameIndex();
if(length > maxLength)
maxLength = length;
}
_fTotalTime = maxLength*_fUnitTime;
}