Commit ee5b6817 authored by wildfirecode's avatar wildfirecode

1

parent d494142d
let soundOn = true; let soundOn = true;
let bgOn = true;
let bgChannel: egret.SoundChannel; let bgChannel: egret.SoundChannel;
let loading = false; let loading = false;
export const getSoundOn = () => { export const getSoundOn = () => {
return soundOn return soundOn
} }
export const getBgOn = () => {
return bgOn
}
export const toggleSound = () => { export const toggleSound = () => {
soundOn = !soundOn; soundOn = !soundOn;
}
export const toggleBg = () => {
bgOn = !bgOn;
if (bgChannel) { if (bgChannel) {
if (!soundOn) { if (!bgOn) {
bgChannel.stop(); bgChannel.stop();
bgChannel = null; bgChannel = null;
} }
} else { } else {
if (soundOn) { if (bgOn) {
playBg(); playBg();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment