File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 build :
99 runs-on : ubuntu-latest
1010 steps :
11- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
11+ - uses : actions/checkout@v4
1212 with :
1313 persist-credentials : false
1414 - name : Install Node.js
15- uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
15+ uses : actions/setup-node@v4
1616 with :
17- node-version : 20
17+ node-version : 22
1818 cache : npm
1919 - run : npm ci
2020 - run : npm run lint
Original file line number Diff line number Diff line change @@ -98,6 +98,29 @@ class SoundBank {
9898 return this . soundEffects . get ( sound ) ;
9999 }
100100
101+ /**
102+ * Remove a single sound player and release its resources.
103+ * @param {string } soundId - the id of the sound player to remove
104+ */
105+ removeSoundPlayer ( soundId ) {
106+ const player = this . soundPlayers [ soundId ] ;
107+ if ( player ) {
108+ player . dispose ( ) ;
109+ delete this . soundPlayers [ soundId ] ;
110+ }
111+
112+ const effects = this . soundEffects . get ( soundId ) ;
113+ if ( effects ) {
114+ if ( player ) {
115+ effects . removeSoundPlayer ( player ) ;
116+ }
117+ effects . dispose ( ) ;
118+ this . soundEffects . delete ( soundId ) ;
119+ }
120+
121+ this . playerTargets . delete ( soundId ) ;
122+ }
123+
101124 /**
102125 * Play a sound.
103126 * @param {Target } target - Target to play for
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ class EffectChain {
8888 * @param {SoundPlayer } soundPlayer - a sound player to stop managing
8989 */
9090 removeSoundPlayer ( soundPlayer ) {
91- this . _soundPlayers . remove ( soundPlayer ) ;
91+ this . _soundPlayers . delete ( soundPlayer ) ;
9292 }
9393
9494 /**
You can’t perform that action at this time.
0 commit comments