Hello, so in my main menu scene and in my settings scene their is an object which holds the same audiosource (with the same audioclip), and this script called MyUnitySingleton:
private static MyUnitySingleton instance = null;
public static MyUnitySingleton Instance
{
get { return instance; }
}
void Awake()
{
if (instance != null && instance != this) {
Destroy(this.gameObject);
return;
} else {
instance = this;
}
DontDestroyOnLoad(this.gameObject);
}
// any other methods you need
I also have my play scene with a different audiosource (and audioclip) in an object with no script. But I dont know how to not have two songs playing at the same time as I am already calling the DontDestroyOnLoad method. Any response is highly appreciated. Thank you in advance!