修复IOS10以上的版本Home切出去再切回来音效消失

在AppDelegate.cpp中

// This function will be called when the app is inactive. When comes a phone call,it's be invoked too
void AppDelegate::applicationDidEnterBackground()
{
Director::getInstance()->stopAnimation();


//SimpleAudioEngine::getInstance()->pauseBackgroundMusic();
SimpleAudioEngine::getInstance()->stopAllEffects();
}


// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground()
{
Director::getInstance()->startAnimation();


//SimpleAudioEngine::getInstance()->resumeBackgroundMusic();
SimpleAudioEngine::getInstance()->resumeAllEffects();
}


编译完成~

cocos2d-x版本 3.10

你可能感兴趣的:(cocos2d-x,C++,cocos2d-x,lua)