Browse Source

Move the validation to main()

customisations
alemart 11 months ago
parent
commit
84c2c97765
1 changed files with 3 additions and 10 deletions
  1. 3
    10
      demos/hello-three/demo.js

+ 3
- 10
demos/hello-three/demo.js View File

5
 
5
 
6
 (function() {
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
  * Utilities for the Demo scene
9
  * Utilities for the Demo scene
16
  */
10
  */
85
     }
79
     }
86
 }
80
 }
87
 
81
 
88
-
89
-
90
 /**
82
 /**
91
  * Demo scene
83
  * Demo scene
92
  */
84
  */
330
     }
322
     }
331
 }
323
 }
332
 
324
 
333
-
334
-
335
 /**
325
 /**
336
  * Enchant the scene
326
  * Enchant the scene
337
  * @returns {void}
327
  * @returns {void}
340
 {
330
 {
341
     const scene = new DemoScene();
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
     encantar(scene).catch(error => {
336
     encantar(scene).catch(error => {
344
         alert(error.message);
337
         alert(error.message);
345
     });
338
     });

Loading…
Cancel
Save