- Home /
Music resumes between levels on iPhone ( and not on android)
Hi!
I have a standard mute button on my app that pauses the music I have running. The music is loaded on level one, loops and contiunes through the game. On Android, everyhting is just fine (both pause and unpasue works like they're supposed to), but on iPhone, as soon as I restart or change any level, my music is unpasued again. Does it re-instantiate or something? And if so, why on iPhone and not on android? Please help! Here is my GameMusic class.
private static GameMusic instance = null;
public static GameMusic Instance
{
get { return instance; }
}
void Awake()
{
if (instance != null && instance != this)
{
Destroy(this.gameObject);
return;
}
else
{
instance = this;
}
DontDestroyOnLoad(this.gameObject);
}
void OnGUI()
{
if (GUI.Button(new Rect(0, 0, 32, 32), soundIcon))
{
AudioListener.pause = true;
}
}
Comment
Your answer
Follow this Question
Related Questions
how to use ipodlibrary? 0 Answers
How do I pause and unpause my game on the iPhone? 1 Answer
Music On/Off Switch 2 Answers
memory usage of compressed audio playerback iphone 1 Answer
Pausing Music 1 Answer