work on victory screen. debugstate component (?debugstate=victory, ?debugstate=gameover, ?debugstate=loading)
This commit is contained in:
12
src/components/debug-state.js
Normal file
12
src/components/debug-state.js
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Emit events from query parameter to state to automatically set up state.
|
||||
*/
|
||||
AFRAME.registerComponent('debug-state', {
|
||||
play: function () {
|
||||
const flags = AFRAME.utils.getUrlParameter('debugstate').trim();
|
||||
if (!flags) { return; }
|
||||
flags.split(',').forEach(flag => {
|
||||
this.el.sceneEl.emit(`debug${flag.trim()}`, null, false);
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user