Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的游戏应用程序中有 8 个级别。每个级别的屏幕右上角都有声音控制按钮。当我单击该按钮时,它会打开/关闭声音。
如果它在一级关闭,它应该在所有级别都关闭。我怎样才能做到这一点?
如果您使用 CocosDenshion 播放音乐,您只需调用
[[SimpleAudioEngine sharedEngine] setBackgroundMusicVolume: value]; [[SimpleAudioEngine sharedEngine] setEffectsVolume: value];
值在 0..1 范围内浮动