mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-27 12:24:30 +08:00
修改样板播放bgm的逻辑
This commit is contained in:
1 parent
48a0752f9c
commit
3604c7550f
4 files changed
+13
-107
No files matched your search
@@ -25,10 +25,15 @@ export class BgmController extends ResourceController<HTMLAudioElement> {
|
||||
play(id: BgmIds, when: number = 0) {
|
||||
if (this.playing === id) return;
|
||||
this.pause();
|
||||
const bgm = this.get(id);
|
||||
bgm.currentTime = when;
|
||||
bgm.play();
|
||||
this.playing = id;
|
||||
if (core.musicStatus.bgmStatus) {
|
||||
const bgm = this.get(id);
|
||||
bgm.currentTime = when;
|
||||
bgm.volume = core.musicStatus.userVolume;
|
||||
bgm.play();
|
||||
this.playing = id;
|
||||
} else {
|
||||
delete this.playing;
|
||||
}
|
||||
this.lastBgm = id;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user