Commit d2859736 authored by 范雪寒's avatar 范雪寒

fix: 右下角播放按钮

parent 2bbabd5a
......@@ -52,7 +52,9 @@ export class Game {
_currentPlayingAudioName;
_currentPlayingAudioCallback;
playAudio(key, now = true, callback = null) {
if (key == '') {
return;
}
if (this._currentPlayingAudioName != '') {
const audio = this._parent.audioObj[this._currentPlayingAudioName];
if (audio) {
......
......@@ -291,10 +291,12 @@ export class MyGame extends Game {
totalAudioBtn.y = this._parent.canvasHeight - totalAudioBtn.height;
totalAudioBtn.addTouchBeganListener(() => {
jelly(totalAudioBtn);
this.playAudio(this.data.totalAudio, true, () => {
totalAudioBtn.init(this.images.get('btn_play'));
});
totalAudioBtn.init(this.images.get('btn_pause'));
if (this.data.totalAudio != '') {
this.playAudio(this.data.totalAudio, true, () => {
totalAudioBtn.init(this.images.get('btn_play'));
});
totalAudioBtn.init(this.images.get('btn_pause'));
}
});
this.addChild(totalAudioBtn);
}
......
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