From 1209acce50516f67edfa45f84050e8f43b7841fe Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Fri, 16 Jun 2023 19:17:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=AB=8B=E4=BD=93=E5=A3=B0?= =?UTF-8?q?=E6=97=B6=E6=9B=B4=E6=96=B0=E9=9F=B3=E9=A2=91=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- idea.md | 2 ++ src/core/audio/sound.ts | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/idea.md b/idea.md index e5a3bb5..9a41816 100644 --- a/idea.md +++ b/idea.md @@ -42,6 +42,8 @@ - 每个怪物加一个怪物说明 - 歌词展示系统 - 小地图显示框,可以选择是否显示剩余怪物数量等 +- 怪物死亡特效 +- 区域名称显示特效,3D 粒子 ### 第二章 智慧 diff --git a/src/core/audio/sound.ts b/src/core/audio/sound.ts index 60094b0..aaa4b21 100644 --- a/src/core/audio/sound.ts +++ b/src/core/audio/sound.ts @@ -11,7 +11,7 @@ export class SoundEffect extends AudioPlayer { private _stopingAll: boolean = false; private playMap: Map = new Map(); - stereo: boolean = false; + private _stereo: boolean = false; gain: GainNode = AudioPlayer.ac.createGain(); panner: PannerNode | null = null; @@ -24,6 +24,14 @@ export class SoundEffect extends AudioPlayer { return this.gain.gain.value; } + set stereo(value: boolean) { + this._stereo = value; + this.initAudio(value); + } + get stereo(): boolean { + return this._stereo; + } + constructor(data: ArrayBuffer, stereo: boolean = false) { super(data); @@ -35,10 +43,10 @@ export class SoundEffect extends AudioPlayer { this.playMap.delete(node); }); this.on('update', () => { - this.initAudio(this.stereo); + this.initAudio(this._stereo); }); - this.stereo = stereo; + this._stereo = stereo; } /**