コード例 #1
0
void GuideManager::showGuideFinger(GuideStep step)
{
    CCPoint p = getStepPosition(step);
    if(p.x ==0 && p.y ==0){
        return;
    }
    if(guideFinger == NULL){
        CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("guide/guide.plist");
        guideFinger = CCSprite::createWithSpriteFrameName("guide_finger.png");
        guideFinger->setAnchorPoint(ccp(0.17, 0.9));
    }
    guideFinger->setVisible(true);
    guideFinger->setPosition(getStepPosition(step));
    if(!guideFinger->getParent()){
        INSTANCE(SceneManager)->addToCurrentScene(guideFinger,zOrder_guide);
    }
    
    hideEffect();
    if(step == GuideStep_10002){
        showStepEffect_10002();
    }
}
コード例 #2
0
void CHeroEvolveEffectLayer::movementCallBack( CCArmature *pArmature, MovementEventType type, const char *str )
{
	switch (type)
	{
	case cocos2d::extension::START:
		break;
	case cocos2d::extension::LOOP_COMPLETE:
	case cocos2d::extension::COMPLETE:
		{

			//太极特效
			if(strcmp(str, "taiji") == 0)
			{

				m_pEffectBase->setVisible(false);
				m_pEffectForChange->setVisible(true);

				//骨骼2.1播放效果-属性增加
				m_pEffectForChange->getAnimation()->play("data", 0.01f);


			}
			//属性变化动作结束
			else if(strcmp(str, "data") == 0)
			{
				//进入第2.2阶段特效播放
				//是否有二阶特效
				if( m_pSkillPanel == nullptr )
				{
					//设置回调
					hideEffect();
					callbackChangeAll();
					return;
				}

				//根据类型区分
				switch (m_eUnLockType)
				{
				case HeroEvolveEffectuUnlockType::UnlockSkill:
					{
						m_pEffectForChange->getAnimation()->play("skill", 0.01f);
					}
					break;
				case HeroEvolveEffectuUnlockType::UnlockBox:
					{
						m_pEffectForChange->getAnimation()->play("box", 0.01f);
					}
					break;
				case HeroEvolveEffectuUnlockType::UnlockExtra:
					{
						m_pEffectForChange->getAnimation()->play("skill", 0.01f);
					}
					break;
				default:
					break;
				}
			}
			//所有特效结束
			else if( strcmp(str, "box") == 0 || strcmp(str, "skill") == 0 )
			{
				//设置回调
				//TODO
				hideEffect();
				callbackChangeAll();
			}
		}
		break;
	default:
		break;
	}
}