Skip to content

Commit

Permalink
Emit engine-init event at the very end of the constructor
Browse files Browse the repository at this point in the history
This allows plugins to perform actions which require all plugins to be
initialized (for example, calling showChunk which requires the mesher
and stitcher and shader to have loaded, and set in the game instance).
  • Loading branch information
deathcap committed Mar 28, 2015
1 parent e9b8f6b commit 6b5c953
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function Game(opts) {

this.cameraPlugin = plugins.get('game-shell-fps-camera') // TODO: support other plugins implementing same API


this.emit('engine-init', this);
}

inherits(Game, EventEmitter)
Expand Down

0 comments on commit 6b5c953

Please sign in to comment.