mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
Updated global play method to accept sound config and sound marker as second argument
This commit is contained in:
parent
66936490a1
commit
6a64693257
1 changed files with 13 additions and 2 deletions
|
@ -113,10 +113,21 @@ var BaseSoundManager = new Class({
|
|||
}
|
||||
return sound;
|
||||
},
|
||||
play: function (key, config) {
|
||||
play: function (key, extra) {
|
||||
var sound = this.add(key);
|
||||
sound.events.once('SOUND_ENDED', sound.destroy.bind(sound));
|
||||
sound.play(config);
|
||||
if (extra) {
|
||||
if (extra.name) {
|
||||
sound.addMarker(extra);
|
||||
sound.play(extra.name);
|
||||
}
|
||||
else {
|
||||
sound.play(extra);
|
||||
}
|
||||
}
|
||||
else {
|
||||
sound.play();
|
||||
}
|
||||
},
|
||||
playAudioSprite: NOOP,
|
||||
remove: NOOP,
|
||||
|
|
Loading…
Reference in a new issue