mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 05:03:37 +00:00
The BaseSoundManager.getAll
method used to require a key
parameter, to return Sounds matching the key. This is now optional and if not given, all Sound instances are returned.
This commit is contained in:
parent
b15880bdea
commit
9bdf022bed
1 changed files with 13 additions and 3 deletions
|
@ -233,7 +233,10 @@ var BaseSoundManager = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* Gets all sounds in this Sound Manager that match the given key.
|
||||
* Gets all sounds in this Sound Manager.
|
||||
*
|
||||
* You can optionally specify a key, in which case only Sound instances that match the given key
|
||||
* will be returned.
|
||||
*
|
||||
* @method Phaser.Sound.BaseSoundManager#getAll
|
||||
* @since 3.23.0
|
||||
|
@ -241,13 +244,20 @@ var BaseSoundManager = new Class({
|
|||
* @generic {Phaser.Sound.BaseSound} T
|
||||
* @genericUse {T[]} - [$return]
|
||||
*
|
||||
* @param {string} key - Sound asset key.
|
||||
* @param {string} [key] - Optional asset key. If given, only Sound instances with this key will be returned.
|
||||
*
|
||||
* @return {Phaser.Sound.BaseSound[]} - The sounds, or an empty array.
|
||||
*/
|
||||
getAll: function (key)
|
||||
{
|
||||
return GetAll(this.sounds, 'key', key);
|
||||
if (key)
|
||||
{
|
||||
return GetAll(this.sounds, 'key', key);
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetAll(this.sounds);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue