Wan开发者_开发知识库t to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this questionI started making a toggle in my Settings scene for background music on/off. I'm not sure how to make this toggle only for background music, since I also have other effects and such in my game. How do I make the toggle only affect the background music in my app?
I have already done so, maybe give some to you!
- (void)muteMusic:(CCMenuItemToggle *)sender
{
if([[SimpleAudioEngine sharedEngine]isBackgroundMusicPlaying])
{
[[SimpleAudioEngine sharedEngine] pauseBackgroundMusic];
} else {
[[SimpleAudioEngine sharedEngine] resumeBackgroundMusic];
}
}
精彩评论