Good Evening All,
I created a method that stops playing the current song and then plays a new song. Though, I’m not certain if this is the best way to do it:
public void PlaySong(EventReference song)
{
// If a previous song is playing stop it.
currentSong.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
// Set the current song
currentSong = RuntimeManager.CreateInstance(song);
// Play the new song
currentSong.start();
}
Rather than always trying to stop a song, I wanted to do a check to see if currentSong is either null or currently playing. Though it looks like using if (currentSong != null) is not valid.
Is there a better way to first check if a song is playing, stop it if so, and then finally play a new song?
Thanks so much for taking the time!