音效修改
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 38s

This commit is contained in:
TJH 2025-10-09 11:39:16 +08:00
parent 10931663d7
commit 30baaaf001

View File

@ -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) {