swift - Mute Music and Mute Sound Buttons -
i putting finishing touches on arcade-style game making using swift , spritekit in xcode.
my game has 2 scenes:
- a main menu scene play button located
- a game play scene.
i want able put node acts button mute background music across both scenes , node acts button mute sound effects across both scenes.
i want both of these buttons located on main menu scene. have idea how program button mute music/sound-effects have no idea how connect button across both scenes.
i stay muted (or un-muted) after user closes app , re-opens it. please need this, , please specific , straightforward on should because new coding. overall, want know how program node acts button able work across , access properties 2 different scenes.
p.s. using avfoundation run music , sound effects
i make avfoundation audio player global ever set up
import avfoundation var player:avaudioplayer = avaudioplayer() class viewcontroller: uiviewcontroller { then on each viewcontroller ctrl drag , drop button in action
@ibaction func mute(sender: anyobject) { player.volume = 0 }
Comments
Post a Comment