Closed ghost closed 9 years ago
Subclassing Singletons is tricky. I can't be sure without looking at your implementation, but I suspect that's the problem.
Why do you need to subclass it?
I subclassed it so that I could keep all my sound logic in one place, and add methods to determine which sound effects to play in certain situations. I suppose I could use a category though. But I also created a bunch of pre-initialised Sound instance variables to avoid the delay in loading them in, which I wouldn't be able to do in a category. Perhaps this is unnecessary though?
Hmm, well I can't actually see any reason why your singleton subclass shouldn't work in this case.
Maybe just put a breakpoint in the playSound methods and see if you can work out why the volume isn't being set correctly?
Ah - I'm just calling [mySound play] rather than [self playSound:mySound]. I suspect that's why, as have set the soundVolume for SoundManager, but not for Sound... Thanks for your help!
This is a great library, thanks! I'm trying to implement a button to toggle all sound effects on/off. I've subclassed SoundManager and called it SoundEffects. However, calling this line doesn't appear to work:
I've stepped through and checked, and the volume is being set to 0. However all sound effects still play. Am I doing something wrong? Could be a subclassing issue?