var Class = require('../utils/Class'); var PluginManager = require('../boot/PluginManager'); var GameObjectCreator = new Class({ initialize: function GameObjectCreator(scene){ this.scene = scene; this.systems = scene.sys; if (!scene.sys.settings.isBooted) { scene.sys.events.once('boot', this.boot, this); } this.displayList; this.updateList; } , boot: function (){ this.displayList = this.systems.displayList; this.updateList = this.systems.updateList; var eventEmitter = this.systems.events; eventEmitter.on('shutdown', this.shutdown, this); eventEmitter.on('destroy', this.destroy, this); } , shutdown: function (){ } , destroy: function (){ this.scene = null ; this.displayList = null ; this.updateList = null ; } } ); GameObjectCreator.register = function (type, factoryFunction){ if (!GameObjectCreator.prototype.hasOwnProperty(type)) { GameObjectCreator.prototype[type] = factoryFunction; } } ; PluginManager.register('GameObjectCreator', GameObjectCreator, 'make'); module.exports = GameObjectCreator;