1
在功能內部工作時,我無法保持在範圍內。引用合適範圍訪問soundManager的最佳方法是什麼?Phaser的範圍問題 - 使用聲音
遺漏的類型錯誤:無法設置的不確定
財產 '遊戲' 在這一行console.log('SCOPE: ' + MyGame.Game.sound.mute);
$(".audiotoggle").click(function() {
if (MyApp1.gameMuted === false) {
MyApp1.gameMuted = true; //(angular vars)
console.log('MUTE: TRUE (audiotoggle * TRIGGER)');
audtioToggleFunc();
} else {
MyApp1.gameMuted = false; //(angular vars)
console.log('MUTE: FALSE (audiotoggle * TRIGGER)');
audtioToggleFunc();
}
});
var audtioToggleFunc = function() {
console.log('SCOPE: ' + MyGame.Game.sound.mute);
console.log('AUDIO TOGGLE');
if (MyApp1.gameMuted === true) {
MyGame.Game.sound.mute = false;
console.log('MUTE: FALSE (audiotoggle * Function)');
} else {
MyGame.Game.sound.mute = true;
console.log('MUTE: TRUE (audiotoggle * Function)');
}
};
audtioToggleFunc();