mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
Extends the Factory.
This commit is contained in:
parent
a15747203e
commit
2dd7e68707
1 changed files with 13 additions and 1 deletions
|
@ -616,8 +616,20 @@ Phaser.Game.prototype = {
|
|||
|
||||
// this.world = new Phaser.World(this);
|
||||
|
||||
// Inject any new Factory helpers that exist in the build
|
||||
for (var gameobject in Phaser.GameObject)
|
||||
{
|
||||
if (Phaser.GameObject[gameobject].hasOwnProperty('FACTORY_KEY'))
|
||||
{
|
||||
var key = Phaser.GameObject[gameobject]['FACTORY_KEY'];
|
||||
|
||||
// console.log('found', key);
|
||||
|
||||
Phaser.GameObject.Factory.prototype[key] = Phaser.GameObject[gameobject]['FACTORY_ADD'];
|
||||
}
|
||||
}
|
||||
|
||||
this.add = new Phaser.GameObject.Factory(this);
|
||||
this.add.boot();
|
||||
|
||||
this.make = new Phaser.GameObjectCreator(this);
|
||||
this.cache = new Phaser.Cache(this);
|
||||
|
|
Loading…
Reference in a new issue