mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 05:03:37 +00:00
Added option to insert plugin into Scene immediately
This commit is contained in:
parent
271c0a08b8
commit
444dda12d7
1 changed files with 15 additions and 15 deletions
|
@ -233,7 +233,7 @@ var PluginManager = new Class({
|
|||
// key = Scene.Systems property key
|
||||
// plugin = code
|
||||
// mapping = Scene key
|
||||
installScenePlugin: function (key, plugin, mapping)
|
||||
installScenePlugin: function (key, plugin, mapping, addToScene)
|
||||
{
|
||||
if (typeof plugin !== 'function')
|
||||
{
|
||||
|
@ -251,6 +251,20 @@ var PluginManager = new Class({
|
|||
corePlugins[key] = { plugin: plugin, mapping: mapping, custom: true };
|
||||
|
||||
this.scenePlugins.push(key);
|
||||
|
||||
if (addToScene)
|
||||
{
|
||||
var instance = new plugin(addToScene, this);
|
||||
|
||||
addToScene.sys[key] = instance;
|
||||
|
||||
if (mapping && mapping !== '')
|
||||
{
|
||||
addToScene[mapping] = instance;
|
||||
}
|
||||
|
||||
instance.boot();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -393,20 +407,6 @@ var PluginManager = new Class({
|
|||
}
|
||||
},
|
||||
|
||||
setScenePlugin: function (scene)
|
||||
{
|
||||
},
|
||||
|
||||
addGameObject: function ()
|
||||
{
|
||||
|
||||
},
|
||||
|
||||
addFileType: function ()
|
||||
{
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue