コード例 #1
0
UIAction* UIActionManager::GetActionByName(const char* actionName)
{
    for (int i=0; i<m_ActionList->count(); i++) {
        UIAction* action = dynamic_cast<UIAction*>(m_ActionList->objectAtIndex(i));
        if (strcmp(actionName, action->getName()) == 0) {
            return action;
        }
    }
    return NULL;
}
コード例 #2
0
UIAction* UIActionManager::GetActionByName(const char* jsonName,const char* actionName)
{
    CCArray* actionList = (CCArray*)(m_pActionDic->objectForKey(jsonName));
    if (!actionList)
    {
        return NULL;
    }
    for (int i=0; i<actionList->count(); i++)
    {
        UIAction* action = dynamic_cast<UIAction*>(actionList->objectAtIndex(i));
        if (strcmp(actionName, action->getName()) == 0)
        {
            return action;
        }
    }
    return NULL;
}