From 7e1a80e33a7810cf4a604bb74c3ce52f2a6886f0 Mon Sep 17 00:00:00 2001 From: Daniel Steckert <71stda1bif@hft-stuttgart.de> Date: Sat, 13 Jun 2020 15:24:56 +0200 Subject: [PATCH] Add logging and remove local references to files --- GoldWars/GoldWars.xcodeproj/project.pbxproj | 24 ++++++++++----------- GoldWars/GoldWars/SoundManager.swift | 4 +++- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/GoldWars/GoldWars.xcodeproj/project.pbxproj b/GoldWars/GoldWars.xcodeproj/project.pbxproj index 5deb8c5..bf2da7c 100644 --- a/GoldWars/GoldWars.xcodeproj/project.pbxproj +++ b/GoldWars/GoldWars.xcodeproj/project.pbxproj @@ -16,9 +16,9 @@ 110360EE244B101B008610AF /* GoldWarsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 110360ED244B101B008610AF /* GoldWarsTests.swift */; }; 11036113244B3E30008610AF /* MenuScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11036112244B3E30008610AF /* MenuScene.swift */; }; 116060F7245C57D2004E5A36 /* EntityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 116060F6245C57D2004E5A36 /* EntityManager.swift */; }; - 2068D0202493D0B400F7A368 /* attack_base.wav in Resources */ = {isa = PBXBuildFile; fileRef = 2068D01D2493D0B400F7A368 /* attack_base.wav */; }; - 2068D0212493D0B400F7A368 /* use_boost.wav in Resources */ = {isa = PBXBuildFile; fileRef = 2068D01E2493D0B400F7A368 /* use_boost.wav */; }; - 2068D0222493D0B400F7A368 /* new_round.wav in Resources */ = {isa = PBXBuildFile; fileRef = 2068D01F2493D0B400F7A368 /* new_round.wav */; }; + 205ED9CB249507E200B28718 /* use_boost.wav in Resources */ = {isa = PBXBuildFile; fileRef = 205ED9C8249507E200B28718 /* use_boost.wav */; }; + 205ED9CC249507E200B28718 /* attack_base.wav in Resources */ = {isa = PBXBuildFile; fileRef = 205ED9C9249507E200B28718 /* attack_base.wav */; }; + 205ED9CD249507E200B28718 /* new_round.wav in Resources */ = {isa = PBXBuildFile; fileRef = 205ED9CA249507E200B28718 /* new_round.wav */; }; 3E67854024728368007B9DE4 /* CElements.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E67853F24728368007B9DE4 /* CElements.swift */; }; 3E6785422472CBEC007B9DE4 /* Way.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6785412472CBEC007B9DE4 /* Way.swift */; }; 3EAD889524801B6A0048A10A /* RoundTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EAD889424801B6A0048A10A /* RoundTimer.swift */; }; @@ -84,9 +84,9 @@ 110360EF244B101B008610AF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 11036112244B3E30008610AF /* MenuScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuScene.swift; sourceTree = ""; }; 116060F6245C57D2004E5A36 /* EntityManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EntityManager.swift; sourceTree = ""; }; - 2068D01D2493D0B400F7A368 /* attack_base.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = attack_base.wav; path = ../../../../Desktop/attack_base.wav; sourceTree = ""; }; - 2068D01E2493D0B400F7A368 /* use_boost.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = use_boost.wav; path = ../../../../Desktop/use_boost.wav; sourceTree = ""; }; - 2068D01F2493D0B400F7A368 /* new_round.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = new_round.wav; path = ../../../../Desktop/new_round.wav; sourceTree = ""; }; + 205ED9C8249507E200B28718 /* use_boost.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = use_boost.wav; sourceTree = ""; }; + 205ED9C9249507E200B28718 /* attack_base.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = attack_base.wav; sourceTree = ""; }; + 205ED9CA249507E200B28718 /* new_round.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = new_round.wav; sourceTree = ""; }; 3E67853F24728368007B9DE4 /* CElements.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CElements.swift; sourceTree = ""; }; 3E6785412472CBEC007B9DE4 /* Way.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Way.swift; sourceTree = ""; }; 3EAD889424801B6A0048A10A /* RoundTimer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundTimer.swift; sourceTree = ""; }; @@ -170,10 +170,10 @@ 110360D1244B101A008610AF /* GoldWars */ = { isa = PBXGroup; children = ( - 2068D01D2493D0B400F7A368 /* attack_base.wav */, - 2068D01F2493D0B400F7A368 /* new_round.wav */, - 2068D01E2493D0B400F7A368 /* use_boost.wav */, C04783ED2468583F004961FB /* intro-music.mp3 */, + 205ED9C9249507E200B28718 /* attack_base.wav */, + 205ED9CA249507E200B28718 /* new_round.wav */, + 205ED9C8249507E200B28718 /* use_boost.wav */, 9ECD3699245C91F7008DEEBD /* GoldWars.entitlements */, 9E11FF74245CD79100EED3BE /* Partikels */, 116060F5245C5709004E5A36 /* Entities */, @@ -379,16 +379,16 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2068D0222493D0B400F7A368 /* new_round.wav in Resources */, + 205ED9CD249507E200B28718 /* new_round.wav in Resources */, 110360DE244B101A008610AF /* Main.storyboard in Resources */, 9E11FF79245CD81100EED3BE /* Fire.sks in Resources */, 110360E0244B101B008610AF /* Assets.xcassets in Resources */, - 2068D0202493D0B400F7A368 /* attack_base.wav in Resources */, - 2068D0212493D0B400F7A368 /* use_boost.wav in Resources */, 110360E3244B101B008610AF /* LaunchScreen.storyboard in Resources */, 9E61EAC4249BAC9100334DDE /* LoserFire.sks in Resources */, C04783EE2468583F004961FB /* intro-music.mp3 in Resources */, + 205ED9CC249507E200B28718 /* attack_base.wav in Resources */, 3F79FFE02486F7CD003F79C3 /* Explosion.sks in Resources */, + 205ED9CB249507E200B28718 /* use_boost.wav in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/GoldWars/GoldWars/SoundManager.swift b/GoldWars/GoldWars/SoundManager.swift index c8d12da..55b7037 100644 --- a/GoldWars/GoldWars/SoundManager.swift +++ b/GoldWars/GoldWars/SoundManager.swift @@ -8,9 +8,11 @@ import SpriteKit import AVFoundation +import os class SoundManager { public static var sharedInstance = SoundManager() + let LOG = OSLog.init(subsystem: "SoundManager", category: "SoundManager") var audioPlayer = AVAudioPlayer() var effectPlayer = AVAudioPlayer() @@ -46,7 +48,7 @@ class SoundManager { do { effectPlayer = try AVAudioPlayer(contentsOf: soundEffect!) } catch { - //TODO: Add logging + os_log("Could not load sound file %@", log: LOG, type: .error, pathToFile) } effectPlayer.volume += volumeLevel effectPlayer.play()