EffectSprite* ElfEffectAnimHandler::GetEffect( int id )
{
	EffectSprite* pRet = NULL;
	if(LevelManager::sShareInstance()->getCurrentLevelLayer()->getObjectLayer())
	{
		cocos2d::CCArray* pArray = LevelManager::sShareInstance()->getCurrentLevelLayer()->getObjectLayer()->getChildren();
		if(pArray)
		{
			for(unsigned int i = 0; i < pArray->data->num; i++)
			{
				EffectSprite* pEffect = dynamic_cast<EffectSprite*>(pArray->data->arr[i]);
				if(pEffect)
				{
					if(pEffect->getType() == id)
					{
						if(!pEffect->isVisible())
						{
							pRet = pEffect;
							break;
						}
					}
				}
			}
		}
	}

	if(pRet == NULL)
	{
		pRet = ParticleManager::Get()->createEffectSprite(id,"");

	}

	pRet->setVisible(true);

	return pRet;
}