Skip to content

Commit 6b5c953

Browse files
committed
Emit engine-init event at the very end of the constructor
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).
1 parent e9b8f6b commit 6b5c953

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ function Game(opts) {
187187

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

190-
190+
this.emit('engine-init', this);
191191
}
192192

193193
inherits(Game, EventEmitter)

0 commit comments

Comments
 (0)