public void Dispose() { this.CancelAllSoundEffects(); this.soundEffects.Clear(); this.isDisposed = true; soundFXInstance = null; }
private SoundFX(IGameContext context) { this.context = context; this.isMuted = false; this.soundEffects = new Dictionary <String, SoundEffect>(); //reset singleton instance soundFXInstance = this; }
public static SoundFX Create(IGameContext context) { soundFXInstance?.CancelAllSoundEffects(); soundFXInstance = soundFXInstance ?? new SoundFX(context); return(soundFXInstance); }