コード例 #1
0
CCShaky3D* CCShaky3D::create(float duration, const CCSize& gridSize, int range, bool shakeZ)
{
    CCShaky3D *pAction = new CCShaky3D();

    if (pAction)
    {
        if (pAction->initWithDuration(duration, gridSize, range, shakeZ))
        {
            pAction->autorelease();
        }
        else
        {
            CC_SAFE_RELEASE_NULL(pAction);
        }
    }

    return pAction;
}
コード例 #2
0
CCObject* CCShaky3D::copyWithZone(CCZone *pZone)
{
    CCZone* pNewZone = NULL;
    CCShaky3D* pCopy = NULL;
    if(pZone && pZone->m_pCopyObject)
    {
        //in case of being called at sub class
        pCopy = (CCShaky3D*)(pZone->m_pCopyObject);
    }
    else
    {
        pCopy = new CCShaky3D();
        pZone = pNewZone = new CCZone(pCopy);
    }

    CCGrid3DAction::copyWithZone(pZone);

    pCopy->initWithDuration(m_fDuration, m_sGridSize, m_nRandrange, m_bShakeZ);
    
    CC_SAFE_DELETE(pNewZone);
    return pCopy;
}