diff --git a/assets/Loading/scripts/manager/AudioManager.ts b/assets/Loading/scripts/manager/AudioManager.ts index 59e938f..52ff2fc 100644 --- a/assets/Loading/scripts/manager/AudioManager.ts +++ b/assets/Loading/scripts/manager/AudioManager.ts @@ -55,19 +55,19 @@ export class AudioManager { } playBGM(name: string, loop: boolean = true) { - // if (this._isMuted || !this._bgmAudioSource) return; - // this._bgmAudioSource.stop(); - // let clip = this._audioClips.get(name); - // if (!clip) { - // console.warn(`BGM ${name} 不存在`); - // return; - // } - // this._bgmClip = clip; - // this._bgmAudioSource.clip = clip; - // this._bgmAudioSource.loop = loop; - // this._bgmAudioSource.volume = this._bgmVolume; - // this._bgmAudioSource.play(); - // this._isPaused = false; + if (this._isMuted || !this._bgmAudioSource) return; + this._bgmAudioSource.stop(); + let clip = this._audioClips.get(name); + if (!clip) { + console.warn(`BGM ${name} 不存在`); + return; + } + this._bgmClip = clip; + this._bgmAudioSource.clip = clip; + this._bgmAudioSource.loop = loop; + this._bgmAudioSource.volume = this._bgmVolume; + this._bgmAudioSource.play(); + this._isPaused = false; } playSFX(name: string, volume: number = 1.0, loop: boolean = false) {