cocos2dx3.2 推断音效是否播放

SimpleAudioEngine类中增加一函数

例如以下

bool isEffectPlaying(unsigned int nSoundId);

定义例如以下

bool SimpleAudioEngine::isEffectPlaying(unsigned int nSoundId)
{
	EffectList::iterator p = sharedList().find(nSoundId);
	bool bRet = false;
	if (p != sharedList().end())
	{
		bRet = p->second->IsPlaying();
	}

	return bRet;
}

完毕

原文地址:https://www.cnblogs.com/mfrbuaa/p/4489486.html