Skip to content

Commit 41956c4

Browse files
committed
Added FB plugin conditional
1 parent 22e6c15 commit 41956c4

4 files changed

Lines changed: 26 additions & 14 deletions

File tree

src/boot/Game.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ if (typeof EXPERIMENTAL)
3131
var ScaleManager = require('./ScaleManager');
3232
}
3333

34+
if (typeof PLUGIN_FBINSTANT)
35+
{
36+
var FacebookInstantGamesPlugin = require('../../plugins/fbinstant/src/FacebookInstantGamesPlugin');
37+
}
38+
3439
/**
3540
* @classdesc
3641
* The Phaser.Game instance is the main controller for the entire Phaser game. It is responsible
@@ -270,6 +275,21 @@ var Game = new Class({
270275
*/
271276
this.plugins = new PluginManager(this, this.config);
272277

278+
if (typeof PLUGIN_FBINSTANT)
279+
{
280+
/**
281+
* An instance of the Facebook Instant Games Plugin.
282+
*
283+
* This will only be available if the plugin has been built into Phaser,
284+
* or you're using the special Facebook Instant Games custom build.
285+
*
286+
* @name Phaser.Game#facebook
287+
* @type {Phaser.FacebookInstantGamesPlugin}
288+
* @since 3.13.0
289+
*/
290+
this.facebook = new FacebookInstantGamesPlugin(this);
291+
}
292+
273293
/**
274294
* Is this Game pending destruction at the start of the next frame?
275295
*

src/phaser-facebook-instant-games.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/phaser.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ if (typeof PLUGIN_CAMERA3D)
5757
Phaser.GameObjects.Creators.Sprite3D = require('../plugins/camera3d/src/sprite3d/Sprite3DCreator');
5858
}
5959

60+
if (typeof PLUGIN_FBINSTANT)
61+
{
62+
Phaser.FacebookInstantGamesPlugin = require('../plugins/fbinstant/src/FacebookInstantGamesPlugin');
63+
}
64+
6065
// Merge in the consts
6166

6267
Phaser = Extend(false, Phaser, CONST);

src/scene/Systems.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ var Systems = new Class({
5555
if (typeof PLUGIN_FBINSTANT)
5656
{
5757
/**
58-
* The FaceBook Instant Games Plugin.
58+
* The Facebook Instant Games Plugin.
5959
*
6060
* @name Phaser.Scenes.Systems#facebook
6161
* @type {any}

0 commit comments

Comments
 (0)