Selaa lähdekoodia

Move the validation to main()

customisations
alemart 11 kuukautta sitten
vanhempi
commit
84c2c97765
1 muutettua tiedostoa jossa 3 lisäystä ja 10 poistoa
  1. 3
    10
      demos/hello-three/demo.js

+ 3
- 10
demos/hello-three/demo.js Näytä tiedosto

@@ -5,12 +5,6 @@
5 5
 
6 6
 (function() {
7 7
 
8
-// Validate
9
-if(typeof encantar === 'undefined')
10
-    throw new Error(`Can't find the three.js plugin for encantar.js`);
11
-
12
-
13
-
14 8
 /**
15 9
  * Utilities for the Demo scene
16 10
  */
@@ -85,8 +79,6 @@ class DemoUtils
85 79
     }
86 80
 }
87 81
 
88
-
89
-
90 82
 /**
91 83
  * Demo scene
92 84
  */
@@ -330,8 +322,6 @@ class DemoScene extends ARScene
330 322
     }
331 323
 }
332 324
 
333
-
334
-
335 325
 /**
336 326
  * Enchant the scene
337 327
  * @returns {void}
@@ -340,6 +330,9 @@ function main()
340 330
 {
341 331
     const scene = new DemoScene();
342 332
 
333
+    if(typeof encantar === 'undefined')
334
+        throw new Error(`Can't find the three.js plugin for encantar.js`);
335
+
343 336
     encantar(scene).catch(error => {
344 337
         alert(error.message);
345 338
     });

Loading…
Peruuta
Tallenna