MusicPlayer: add Enabled bool (defaults to off)

This commit is contained in:
Colin McMillen 2021-07-12 15:27:29 -04:00
parent d2d671e24f
commit 7ed2f3ebb6

View File

@ -4,6 +4,8 @@ using System;
namespace SemiColinGames { namespace SemiColinGames {
public class MusicPlayer : IDisposable { public class MusicPlayer : IDisposable {
public static bool Enabled = false;
private SoundEffectInstance music; private SoundEffectInstance music;
~MusicPlayer() { ~MusicPlayer() {
@ -34,7 +36,9 @@ namespace SemiColinGames {
} }
public void Play() { public void Play() {
if (Enabled) {
music?.Play(); music?.Play();
} }
} }
} }
}