zhouenguang 3 anos atrás
pai
commit
90d1b9cb65
2 arquivos alterados com 8 adições e 8 exclusões
  1. 3 5
      index.html
  2. 5 3
      modules/index.js

+ 3 - 5
index.html

@@ -189,11 +189,9 @@
           scene = window.app.scene;
         };
 
-        document.getElementById("enterBtn").onclick = async() => {
-          initFunction().then(() => {
-            sceneToRender = scene;
-          });
-        }
+        initFunction().then(() => {
+          sceneToRender = scene;
+        });
 
         window.scene = scene;
         window.engine = engine;

+ 5 - 3
modules/index.js

@@ -33,9 +33,11 @@ export default class App {
 
         this.hasVideoTexture = true
 
-        this.init()
-        this.bindEvents()
-        setTimeout(() => this.bindSocketEvents(), 1000)
+        document.getElementById("enterBtn").onclick = () => {
+            this.init()
+            this.bindEvents()
+            setTimeout(() => this.bindSocketEvents(), 1000)
+        }
     }
 
     init() {