MusicPlayer: add Enabled bool (defaults to off)
This commit is contained in:
parent
d2d671e24f
commit
7ed2f3ebb6
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user