I've run into a slight problem. When I restart my game (by running my own initialize method), I can successfully reload all my objects/variables. But the initial SoundEffectInstance
I used continues to play while a new instance is created. This results in multiple instances of the same music being played simultaneously.
What I'm trying to achieve is a way to get rid of the first instance when making a new one.
instance.Dispose();
can't be used as it means I can't re-initialize the sound.
I tried using a list to solve this (removing instances before restarting game), but it seems I can't CreateInstance()
from within the list, restricting me from initializing the sound to begin with.
Arrays don't seem to offer a solution either. Any ideas?