I have the following scenario
"Main menu" scene containing a game object with an audio source component and a music manager script.
An "about us" scene
Music manager script :
using UnityEngine;
using System.Collections;
public class ManageMusic : MonoBehaviour {
public static ManageMusic Instance;
void Awake()
{
if (Instance)
DestroyImmediate (gameObject);
else {
DontDestroyOnLoad (gameObject);
Instance = this;
}
}
}
When I click on the "about us" button, the Game Music object
keeps on playing and I can hear the music, but when I return back to the main menu no music is playing. I can see that the music game object is not destroyed when I return to the main menu and the audio listener has the value of the volume set to 1
, but I can't figure out the problem.