Dispatching event when global rate value changes

This commit is contained in:
Pavle Goloskokovic 2018-01-03 21:28:45 +01:00
parent 3b5289a733
commit f6976daf2b

View file

@ -1,6 +1,7 @@
var Class = require('../utils/Class');
var NOOP = require('../utils/NOOP');
var EventDispatcher = require('../events/EventDispatcher');
var SoundValueEvent = require('./SoundValueEvent');
// Phaser.Sound.BaseSoundManager
var BaseSoundManager = new Class({
initialize: function BaseSoundManager(game) {
@ -155,6 +156,7 @@ Object.defineProperty(BaseSoundManager.prototype, 'rate', {
this.sounds.forEach(function (sound) {
sound.setRate();
}, this);
this.events.dispatch(new SoundValueEvent(this, 'SOUND_RATE', value));
}
});
/**