The Game.registry, which is a DataManager instance that can be used as a global store of game wide data will now use its own Event Emitter, instead of the Game's Event Emitter. This means it's perfectly safe for you to now use the Registry to emit and listen for your own custom events without conflicting with events the Phaser Game instance emits.

This commit is contained in:
Richard Davey 2023-01-06 17:19:45 +00:00
parent 8abfcd2f6f
commit 51d10677b1

View file

@ -187,13 +187,15 @@ var Game = new Class({
this.cache = new CacheManager(this);
/**
* An instance of the Data Manager
* An instance of the Data Manager. This is a global manager, available from any Scene
* and allows you to share and exchange your own game-level data or events without having
* to use an internal event system.
*
* @name Phaser.Game#registry
* @type {Phaser.Data.DataManager}
* @since 3.0.0
*/
this.registry = new DataManager(this);
this.registry = new DataManager(this, new EventEmitter());
/**
* An instance of the Input Manager.