pauseBgm
This commit is contained in:
parent
e317259f42
commit
fb8145a9f4
@ -145,7 +145,7 @@ editor_blockly = function () {
|
|||||||
MotaActionBlocks['screenFlash_s'].xmlText(),
|
MotaActionBlocks['screenFlash_s'].xmlText(),
|
||||||
MotaActionBlocks['setWeather_s'].xmlText(),
|
MotaActionBlocks['setWeather_s'].xmlText(),
|
||||||
MotaActionBlocks['playBgm_s'].xmlText(),
|
MotaActionBlocks['playBgm_s'].xmlText(),
|
||||||
// MotaActionBlocks['pauseBgm_s'].xmlText(),
|
MotaActionBlocks['pauseBgm_s'].xmlText(),
|
||||||
// MotaActionBlocks['resumeBgm_s'].xmlText(),
|
// MotaActionBlocks['resumeBgm_s'].xmlText(),
|
||||||
MotaActionBlocks['loadBgm_s'].xmlText(),
|
MotaActionBlocks['loadBgm_s'].xmlText(),
|
||||||
MotaActionBlocks['freeBgm_s'].xmlText(),
|
MotaActionBlocks['freeBgm_s'].xmlText(),
|
||||||
|
|||||||
@ -1273,15 +1273,13 @@ async可选,如果为true则会异步执行(即不等待当前事件执行
|
|||||||
### pauseBgm:暂停背景音乐
|
### pauseBgm:暂停背景音乐
|
||||||
|
|
||||||
使用`{"type": "pauseBgm"}`可以暂停背景音乐的播放。
|
使用`{"type": "pauseBgm"}`可以暂停背景音乐的播放。
|
||||||
|
<!--
|
||||||
**从V2.5.4开始不再支持此事件,请通过设置音量来达到此效果。**
|
|
||||||
|
|
||||||
### resumeBgm:恢复背景音乐
|
### resumeBgm:恢复背景音乐
|
||||||
|
|
||||||
使用`{"type": "resumeBgm"}`可以恢复背景音乐的播放。
|
使用`{"type": "resumeBgm"}`可以恢复背景音乐的播放。
|
||||||
|
|
||||||
**从V2.5.4开始不再支持此事件,请通过设置音量来达到此效果。**
|
**从V2.5.4开始不再支持此事件,请通过设置音量来达到此效果。**
|
||||||
|
-->
|
||||||
### loadBgm:预加载一个背景音乐
|
### loadBgm:预加载一个背景音乐
|
||||||
|
|
||||||
使用loadBgm可以预加载一个背景音乐。
|
使用loadBgm可以预加载一个背景音乐。
|
||||||
|
|||||||
@ -2608,6 +2608,7 @@ control.prototype.pauseBgm = function () {
|
|||||||
try {
|
try {
|
||||||
if (core.isset(core.musicStatus.playingBgm)) {
|
if (core.isset(core.musicStatus.playingBgm)) {
|
||||||
core.material.bgms[core.musicStatus.playingBgm].pause();
|
core.material.bgms[core.musicStatus.playingBgm].pause();
|
||||||
|
core.musicStatus.playingBgm = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
@ -2615,7 +2616,6 @@ control.prototype.pauseBgm = function () {
|
|||||||
main.log(e);
|
main.log(e);
|
||||||
}
|
}
|
||||||
this.setMusicBtn();
|
this.setMusicBtn();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 恢复背景音乐的播放 //////
|
////// 恢复背景音乐的播放 //////
|
||||||
|
|||||||
@ -928,11 +928,11 @@ events.prototype.doAction = function() {
|
|||||||
core.playBgm(data.name);
|
core.playBgm(data.name);
|
||||||
this.doAction();
|
this.doAction();
|
||||||
break;
|
break;
|
||||||
/*
|
|
||||||
case "pauseBgm":
|
case "pauseBgm":
|
||||||
core.pauseBgm();
|
core.pauseBgm();
|
||||||
this.doAction();
|
this.doAction();
|
||||||
break
|
break
|
||||||
|
/*
|
||||||
case "resumeBgm":
|
case "resumeBgm":
|
||||||
core.resumeBgm();
|
core.resumeBgm();
|
||||||
this.doAction();
|
this.doAction();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user