Avoid preload while music off

This commit is contained in:
ckcz123 2018-12-23 17:37:26 +08:00
parent 4a44937e37
commit 1d7caccb32

View File

@ -272,6 +272,8 @@ loader.prototype.freeBgm = function (name) {
loader.prototype.loadBgm = function (name) {
if (!core.isset(core.material.bgms[name])) return;
// 如果没开启音乐,则不预加载
if (!core.musicStatus.bgmStatus) return;
// 是否已经预加载过
var index = core.musicStatus.cachedBgms.indexOf(name);
if (index>=0) {