Skip to content

Commit 3ba7749

Browse files
committed
Config now gets the DefaultScenePlugins
1 parent 31882e5 commit 3ba7749

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

src/DefaultScenePlugins.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// These plugins are created in Scene.Systems by default, in addition to the CoreScenePlugins.
2+
// You can elect not to have these plugins by either creating a DefaultPlugins object as part
3+
// of the Game Config, or by creating a Plugins object as part of a Scene Config.
4+
// They are optionally exposed in the Scene as well (see the InjectionMap for details)
5+
6+
// They are always created in the order in which they appear in the array.
7+
8+
// TODO - Add Data
9+
10+
var DefaultScenePlugins = [
11+
12+
'Clock',
13+
'InputPlugin',
14+
'Loader',
15+
'TweenManager'
16+
17+
];
18+
19+
module.exports = DefaultScenePlugins;

src/boot/Config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var Class = require('../utils/Class');
22
var CONST = require('../const');
3+
var DefaultScenePlugins = require('../DefaultScenePlugins');
34
var GetValue = require('../utils/object/GetValue');
45
var MATH = require('../math/const');
56
var NOOP = require('../utils/NOOP');
@@ -181,6 +182,9 @@ var Config = new Class({
181182
this.physics = GetValue(config, 'physics', {});
182183
this.defaultPhysicsSystem = GetValue(this.physics, 'default', false);
183184

185+
// Scene Plugins
186+
this.defaultPlugins = GetValue(config, 'plugins', DefaultScenePlugins);
187+
184188
// Default / Missing Images
185189
var pngPrefix = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg';
186190

0 commit comments

Comments
 (0)