Skip to content
Snippets Groups Projects
Commit b5226713 authored by netpro2k's avatar netpro2k
Browse files

Wait until play to update component state for vr-mode-toggle-visibility

parent cc8eb624
No related branches found
No related tags found
No related merge requests found
...@@ -175,10 +175,10 @@ AFRAME.registerComponent("vr-mode-toggle-visibility", { ...@@ -175,10 +175,10 @@ AFRAME.registerComponent("vr-mode-toggle-visibility", {
init() { init() {
this.updateComponentState = this.updateComponentState.bind(this); this.updateComponentState = this.updateComponentState.bind(this);
this.updateComponentState();
}, },
play() { play() {
this.updateComponentState();
this.el.sceneEl.addEventListener("enter-vr", this.updateComponentState); this.el.sceneEl.addEventListener("enter-vr", this.updateComponentState);
this.el.sceneEl.addEventListener("exit-vr", this.updateComponentState); this.el.sceneEl.addEventListener("exit-vr", this.updateComponentState);
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment