Merge branch '97-music-flag' into 'development'
Resolve "Music Flag" Closes #97 See merge request marcel.schwarz/software-projekt-2!116
This commit is contained in:
commit
79781ccdc9
@ -56,7 +56,7 @@ class MenuScene: SKScene {
|
||||
entityManager.add(Background(size: self.size))
|
||||
entityManager.add(SpinningLogoEntity(position: CGPoint(x: midX, y: midY + 200)))
|
||||
|
||||
if SoundManager.sharedInstance.isMusicPlaying == false && SoundManager.sharedInstance.isMusicEnabled == true {
|
||||
if SoundManager.sharedInstance.isMusicPlaying == false && SoundManager.sharedInstance.isMusicEnabled == true && !CommandLine.arguments.contains("--no-music") && !UserDefaults.standard.bool(forKey: "noMusic"){
|
||||
SoundManager.sharedInstance.startMenuMusic()
|
||||
}
|
||||
}
|
||||
|
@ -29,12 +29,14 @@ class SoundManager {
|
||||
audioPlayer.prepareToPlay()
|
||||
if self.isMusicEnabled == true {
|
||||
audioPlayer.play()
|
||||
UserDefaults.standard.set(false, forKey: "noMusic")
|
||||
}
|
||||
}
|
||||
|
||||
func stopMenuMusic() {
|
||||
audioPlayer.pause()
|
||||
self.isMusicPlaying = false
|
||||
UserDefaults.standard.set(true, forKey: "noMusic")
|
||||
}
|
||||
|
||||
func setVolume(_ volume: Float) {
|
||||
|
Loading…
Reference in New Issue
Block a user