I have the following scenario
- Main menu scene containing a gameobject with an audio source component
- An about us scene
gameObject script :
using UnityEngine;
using System.Collections;
public class ManageMusic : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public static ManageMusic Instance;
void Awake()
{
if (Instance)
DestroyImmediate (gameObject);
else {
DontDestroyOnLoad (gameObject);
Instance = this;
}
}
}
when i click on aboutUs Button the Game Music object
keep on playing an i can hear the music but when i return back to the main menu no music is still playing . i can see that the gameobject is not destroyed when i return to the main menu and the audio Listener have the value of the volume set to 1
, but i can't figure out the problem can anyone help me