@galacean/engine-loader 0.9.0-beta.82 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.js CHANGED
@@ -3,54 +3,37 @@ import { SphericalHarmonics3, Vector2, Vector3, Vector4, Color, Quaternion, Matr
3
3
  import { DRACODecoder } from '@galacean/engine-draco';
4
4
  import { GLCompressedTextureInternalFormat } from '@galacean/engine-rhi-webgl';
5
5
 
6
- function extends_() {
7
- extends_ = Object.assign || function (target) {
8
- for (var i = 1; i < arguments.length; i++) {
9
- var source = arguments[i];
10
-
11
- for (var key in source) {
12
- if (Object.prototype.hasOwnProperty.call(source, key)) {
13
- target[key] = source[key];
6
+ function _extends() {
7
+ _extends = Object.assign || function assign(target) {
8
+ for (var i = 1; i < arguments.length; i++) {
9
+ var source = arguments[i];
10
+ for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
14
11
  }
15
- }
16
- }
17
12
 
18
- return target;
19
- };
20
-
21
- return extends_.apply(this, arguments);
22
- }
13
+ return target;
14
+ };
23
15
 
24
- function _extends() {
25
- return extends_.apply(this, arguments);
16
+ return _extends.apply(this, arguments);
26
17
  }
27
18
 
28
- function setPrototypeOf(o, p) {
29
- setPrototypeOf = Object.setPrototypeOf || function setPrototypeOf(o, p) {
30
- o.__proto__ = p;
31
- return o;
32
- };
19
+ function _set_prototype_of(o, p) {
20
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
21
+ o.__proto__ = p;
33
22
 
34
- return setPrototypeOf(o, p);
35
- }
23
+ return o;
24
+ };
36
25
 
37
- function _setPrototypeOf(o, p) {
38
- return setPrototypeOf(o, p);
26
+ return _set_prototype_of(o, p);
39
27
  }
40
28
 
41
29
  function _inherits(subClass, superClass) {
42
- if (typeof superClass !== "function" && superClass !== null) {
43
- throw new TypeError("Super expression must either be null or a function");
44
- }
45
-
46
- subClass.prototype = Object.create(superClass && superClass.prototype, {
47
- constructor: {
48
- value: subClass,
49
- writable: true,
50
- configurable: true
30
+ if (typeof superClass !== "function" && superClass !== null) {
31
+ throw new TypeError("Super expression must either be null or a function");
51
32
  }
52
- });
53
- if (superClass) _setPrototypeOf(subClass, superClass);
33
+
34
+ subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
35
+
36
+ if (superClass) _set_prototype_of(subClass, superClass);
54
37
  }
55
38
 
56
39
  /******************************************************************************
@@ -266,39 +249,34 @@ EnvLoader = __decorate([
266
249
  ], EnvLoader);
267
250
 
268
251
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
269
- try {
270
- var info = gen[key](arg);
271
- var value = info.value;
272
- } catch (error) {
273
- reject(error);
274
- return;
275
- }
276
-
277
- if (info.done) {
278
- resolve(value);
279
- } else {
280
- Promise.resolve(value).then(_next, _throw);
281
- }
252
+ try {
253
+ var info = gen[key](arg);
254
+ var value = info.value;
255
+ } catch (error) {
256
+ reject(error);
257
+ return;
258
+ }
259
+ if (info.done) resolve(value);
260
+ else Promise.resolve(value).then(_next, _throw);
282
261
  }
262
+ function _async_to_generator(fn) {
263
+ return function() {
264
+ var self = this, args = arguments;
283
265
 
284
- function _asyncToGenerator(fn) {
285
- return function () {
286
- var self = this,
287
- args = arguments;
288
- return new Promise(function (resolve, reject) {
289
- var gen = fn.apply(self, args);
266
+ return new Promise(function(resolve, reject) {
267
+ var gen = fn.apply(self, args);
290
268
 
291
- function _next(value) {
292
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
293
- }
269
+ function _next(value) {
270
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
271
+ }
294
272
 
295
- function _throw(err) {
296
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
297
- }
273
+ function _throw(err) {
274
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
275
+ }
298
276
 
299
- _next(undefined);
300
- });
301
- };
277
+ _next(undefined);
278
+ });
279
+ };
302
280
  }
303
281
 
304
282
  var FontLoader = /*#__PURE__*/ function(Loader) {
@@ -331,7 +309,7 @@ var FontLoader = /*#__PURE__*/ function(Loader) {
331
309
  });
332
310
  };
333
311
  _proto._registerFont = function _registerFont(fontName, fontUrl) {
334
- return _asyncToGenerator(function() {
312
+ return _async_to_generator(function() {
335
313
  var fontFace;
336
314
  return __generator(this, function(_state) {
337
315
  switch(_state.label){
@@ -944,36 +922,41 @@ var TextureWrapMode;
944
922
  return GLTFUtil;
945
923
  }();
946
924
 
947
- function _arrayLikeToArray(arr, len) {
948
- if (len == null || len > arr.length) len = arr.length;
949
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
950
- return arr2;
925
+ function _array_like_to_array(arr, len) {
926
+ if (len == null || len > arr.length) len = arr.length;
927
+
928
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
929
+
930
+ return arr2;
951
931
  }
952
932
 
953
- function _arrayWithoutHoles(arr) {
954
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
933
+ function _array_without_holes(arr) {
934
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
955
935
  }
956
936
 
957
- function _iterableToArray(iter) {
958
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
937
+ function _iterable_to_array(iter) {
938
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
939
+ return Array.from(iter);
940
+ }
959
941
  }
960
942
 
961
- function _nonIterableSpread() {
962
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
943
+ function _non_iterable_spread() {
944
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
963
945
  }
964
946
 
965
- function _unsupportedIterableToArray(o, minLen) {
966
- if (!o) return;
967
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
968
- var n = Object.prototype.toString.call(o).slice(8, -1);
969
- if (n === "Object" && o.constructor) n = o.constructor.name;
970
- if (n === "Map" || n === "Set") return Array.from(n);
971
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
972
- return _arrayLikeToArray(o, minLen);
947
+ function _unsupported_iterable_to_array(o, minLen) {
948
+ if (!o) return;
949
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
950
+
951
+ var n = Object.prototype.toString.call(o).slice(8, -1);
952
+
953
+ if (n === "Object" && o.constructor) n = o.constructor.name;
954
+ if (n === "Map" || n === "Set") return Array.from(n);
955
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
973
956
  }
974
957
 
975
- function _toConsumableArray(arr) {
976
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
958
+ function _to_consumable_array(arr) {
959
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
977
960
  }
978
961
 
979
962
  var Parser = /*#__PURE__*/ function() {
@@ -990,7 +973,7 @@ var Parser = /*#__PURE__*/ function() {
990
973
  extensionSchema,
991
974
  parseResource,
992
975
  context
993
- ].concat(_toConsumableArray(extra)));
976
+ ].concat(_to_consumable_array(extra)));
994
977
  }
995
978
  }
996
979
  };
@@ -1004,7 +987,7 @@ var Parser = /*#__PURE__*/ function() {
1004
987
  return (_parsers_ = parsers[0]).createEngineResource.apply(_parsers_, [
1005
988
  extensionSchema,
1006
989
  context
1007
- ].concat(_toConsumableArray(extra)));
990
+ ].concat(_to_consumable_array(extra)));
1008
991
  }
1009
992
  };
1010
993
  Parser.hasExtensionParser = function hasExtensionParser(extensionName) {
@@ -1029,7 +1012,9 @@ var Parser = /*#__PURE__*/ function() {
1029
1012
  };
1030
1013
  return Parser;
1031
1014
  }();
1032
- Parser._extensionParsers = {};
1015
+ (function() {
1016
+ Parser._extensionParsers = {};
1017
+ })();
1033
1018
  /**
1034
1019
  * Declare ExtensionParser's decorator.
1035
1020
  * @param extensionName - Extension name
@@ -1104,11 +1089,9 @@ KHR_draco_mesh_compression = __decorate([
1104
1089
  ], KHR_draco_mesh_compression);
1105
1090
 
1106
1091
  function _instanceof(left, right) {
1107
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
1108
- return !!right[Symbol.hasInstance](left);
1109
- } else {
1110
- return left instanceof right;
1111
- }
1092
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
1093
+ return !!right[Symbol.hasInstance](left);
1094
+ } else return left instanceof right;
1112
1095
  }
1113
1096
 
1114
1097
  var KHR_lights_punctual = /*#__PURE__*/ function(ExtensionParser) {
@@ -1431,23 +1414,24 @@ GalaceanMaterialsRemap = __decorate([
1431
1414
  registerExtension("OASIS_materials_remap")
1432
1415
  ], GalaceanMaterialsRemap);
1433
1416
 
1434
- function _createForOfIteratorHelperLoose(o, allowArrayLike) {
1417
+ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1435
1418
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
1419
+
1436
1420
  if (it) return (it = it.call(o)).next.bind(it);
1437
1421
  // Fallback for engines without symbol support
1438
- if (
1439
- Array.isArray(o) ||
1440
- (it = _unsupportedIterableToArray(o)) ||
1441
- (allowArrayLike && o && typeof o.length === "number")
1442
- ) {
1422
+ if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === "number") {
1443
1423
  if (it) o = it;
1424
+
1444
1425
  var i = 0;
1445
- return function () {
1426
+
1427
+ return function() {
1446
1428
  if (i >= o.length) return { done: true };
1429
+
1447
1430
  return { done: false, value: o[i++] };
1448
- }
1431
+ };
1449
1432
  }
1450
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1433
+
1434
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1451
1435
  }
1452
1436
 
1453
1437
  var AnimationParser = /*#__PURE__*/ function(Parser) {
@@ -1740,7 +1724,9 @@ var EntityParser = /*#__PURE__*/ function(Parser) {
1740
1724
  };
1741
1725
  return EntityParser;
1742
1726
  }(Parser);
1743
- /** @internal */ EntityParser._defaultName = "_GLTF_ENTITY_";
1727
+ (function() {
1728
+ /** @internal */ EntityParser._defaultName = "_GLTF_ENTITY_";
1729
+ })();
1744
1730
 
1745
1731
  var MeshParser = /*#__PURE__*/ function(Parser1) {
1746
1732
  _inherits(MeshParser, Parser1);
@@ -2022,7 +2008,9 @@ var MeshParser = /*#__PURE__*/ function(Parser1) {
2022
2008
  };
2023
2009
  return MeshParser;
2024
2010
  }(Parser);
2025
- MeshParser._tempVector3 = new Vector3();
2011
+ (function() {
2012
+ MeshParser._tempVector3 = new Vector3();
2013
+ })();
2026
2014
 
2027
2015
  var SceneParser$1 = /*#__PURE__*/ function(Parser1) {
2028
2016
  _inherits(SceneParser, Parser1);
@@ -2231,7 +2219,7 @@ var SkinParser = /*#__PURE__*/ function(Parser) {
2231
2219
  };
2232
2220
  _proto._findSkeletonRootBone = function _findSkeletonRootBone(joints, entities) {
2233
2221
  var paths = {};
2234
- for(var _iterator = _createForOfIteratorHelperLoose(joints), _step; !(_step = _iterator()).done;){
2222
+ for(var _iterator = _create_for_of_iterator_helper_loose(joints), _step; !(_step = _iterator()).done;){
2235
2223
  var index = _step.value;
2236
2224
  var path = new Array();
2237
2225
  var entity = entities[index];
@@ -2333,8 +2321,10 @@ var TextureParser = /*#__PURE__*/ function(Parser) {
2333
2321
  };
2334
2322
  return TextureParser;
2335
2323
  }(Parser);
2336
- var _obj;
2337
- TextureParser._wrapMap = (_obj = {}, _obj[TextureWrapMode.CLAMP_TO_EDGE] = TextureWrapMode$1.Clamp, _obj[TextureWrapMode.MIRRORED_REPEAT] = TextureWrapMode$1.Mirror, _obj[TextureWrapMode.REPEAT] = TextureWrapMode$1.Repeat, _obj);
2324
+ (function() {
2325
+ var _obj;
2326
+ TextureParser._wrapMap = (_obj = {}, _obj[TextureWrapMode.CLAMP_TO_EDGE] = TextureWrapMode$1.Clamp, _obj[TextureWrapMode.MIRRORED_REPEAT] = TextureWrapMode$1.Mirror, _obj[TextureWrapMode.REPEAT] = TextureWrapMode$1.Repeat, _obj);
2327
+ })();
2338
2328
 
2339
2329
  var Validator = /*#__PURE__*/ function(Parser1) {
2340
2330
  _inherits(Validator, Parser1);
@@ -2406,17 +2396,19 @@ var GLTFParser = /*#__PURE__*/ function() {
2406
2396
  };
2407
2397
  return GLTFParser;
2408
2398
  }();
2409
- GLTFParser.defaultPipeline = new GLTFParser([
2410
- BufferParser,
2411
- Validator,
2412
- TextureParser,
2413
- MaterialParser,
2414
- MeshParser,
2415
- EntityParser,
2416
- SkinParser,
2417
- AnimationParser,
2418
- SceneParser$1
2419
- ]);
2399
+ (function() {
2400
+ GLTFParser.defaultPipeline = new GLTFParser([
2401
+ BufferParser,
2402
+ Validator,
2403
+ TextureParser,
2404
+ MaterialParser,
2405
+ MeshParser,
2406
+ EntityParser,
2407
+ SkinParser,
2408
+ AnimationParser,
2409
+ SceneParser$1
2410
+ ]);
2411
+ })();
2420
2412
 
2421
2413
  /**
2422
2414
  * Product after GLTF parser, usually, `defaultSceneRoot` is only needed to use.
@@ -2468,7 +2460,7 @@ var GLTFLoader = /*#__PURE__*/ function(Loader) {
2468
2460
  context.keepMeshData = (_item_params_keepMeshData = (_item_params = item.params) == null ? void 0 : _item_params.keepMeshData) != null ? _item_params_keepMeshData : false;
2469
2461
  masterPromiseInfo.onCancel(function() {
2470
2462
  var chainPromises = context.chainPromises;
2471
- for(var _iterator = _createForOfIteratorHelperLoose(chainPromises), _step; !(_step = _iterator()).done;){
2463
+ for(var _iterator = _create_for_of_iterator_helper_loose(chainPromises), _step; !(_step = _iterator()).done;){
2472
2464
  var promise = _step.value;
2473
2465
  promise.cancel();
2474
2466
  }
@@ -2729,37 +2721,75 @@ var HDRLoader = (_HDRLoader = /*#__PURE__*/ function(Loader) {
2729
2721
  color.a *= M;
2730
2722
  };
2731
2723
  return HDRLoader1;
2732
- }(Loader), _HDRLoader._rightBottomBack = new Vector3(1.0, -1.0, -1.0), _HDRLoader._rightBottomFront = new Vector3(1.0, -1.0, 1.0), _HDRLoader._rightUpBack = new Vector3(1.0, 1.0, -1.0), _HDRLoader._rightUpFront = new Vector3(1.0, 1.0, 1.0), _HDRLoader._leftBottomBack = new Vector3(-1.0, -1.0, -1.0), _HDRLoader._leftBottomFront = new Vector3(-1.0, -1.0, 1.0), _HDRLoader._leftUpBack = new Vector3(-1.0, 1.0, -1.0), _HDRLoader._leftUpFront = new Vector3(-1.0, 1.0, 1.0), _HDRLoader._faceRight = [
2733
- _HDRLoader._rightBottomBack,
2734
- _HDRLoader._rightBottomFront,
2735
- _HDRLoader._rightUpBack,
2736
- _HDRLoader._rightUpFront
2737
- ], _HDRLoader._faceLeft = [
2738
- _HDRLoader._leftBottomFront,
2739
- _HDRLoader._leftBottomBack,
2740
- _HDRLoader._leftUpFront,
2741
- _HDRLoader._leftUpBack
2742
- ], _HDRLoader._faceUp = [
2743
- _HDRLoader._leftBottomFront,
2744
- _HDRLoader._rightBottomFront,
2745
- _HDRLoader._leftBottomBack,
2746
- _HDRLoader._rightBottomBack
2747
- ], _HDRLoader._faceBottom = [
2748
- _HDRLoader._leftUpBack,
2749
- _HDRLoader._rightUpBack,
2750
- _HDRLoader._leftUpFront,
2751
- _HDRLoader._rightUpFront
2752
- ], _HDRLoader._faceFront = [
2753
- _HDRLoader._leftBottomBack,
2754
- _HDRLoader._rightBottomBack,
2755
- _HDRLoader._leftUpBack,
2756
- _HDRLoader._rightUpBack
2757
- ], _HDRLoader._faceBack = [
2758
- _HDRLoader._rightBottomFront,
2759
- _HDRLoader._leftBottomFront,
2760
- _HDRLoader._rightUpFront,
2761
- _HDRLoader._leftUpFront
2762
- ], _HDRLoader._tempVector3 = new Vector3(), _HDRLoader._temp2Vector3 = new Vector3(), _HDRLoader._temp3Vector3 = new Vector3(), _HDRLoader._temp4Vector3 = new Vector3(), _HDRLoader._temp5Vector3 = new Vector3(), _HDRLoader);
2724
+ }(Loader), function() {
2725
+ _HDRLoader._rightBottomBack = new Vector3(1.0, -1.0, -1.0);
2726
+ }(), function() {
2727
+ _HDRLoader._rightBottomFront = new Vector3(1.0, -1.0, 1.0);
2728
+ }(), function() {
2729
+ _HDRLoader._rightUpBack = new Vector3(1.0, 1.0, -1.0);
2730
+ }(), function() {
2731
+ _HDRLoader._rightUpFront = new Vector3(1.0, 1.0, 1.0);
2732
+ }(), function() {
2733
+ _HDRLoader._leftBottomBack = new Vector3(-1.0, -1.0, -1.0);
2734
+ }(), function() {
2735
+ _HDRLoader._leftBottomFront = new Vector3(-1.0, -1.0, 1.0);
2736
+ }(), function() {
2737
+ _HDRLoader._leftUpBack = new Vector3(-1.0, 1.0, -1.0);
2738
+ }(), function() {
2739
+ _HDRLoader._leftUpFront = new Vector3(-1.0, 1.0, 1.0);
2740
+ }(), function() {
2741
+ _HDRLoader._faceRight = [
2742
+ _HDRLoader._rightBottomBack,
2743
+ _HDRLoader._rightBottomFront,
2744
+ _HDRLoader._rightUpBack,
2745
+ _HDRLoader._rightUpFront
2746
+ ];
2747
+ }(), function() {
2748
+ _HDRLoader._faceLeft = [
2749
+ _HDRLoader._leftBottomFront,
2750
+ _HDRLoader._leftBottomBack,
2751
+ _HDRLoader._leftUpFront,
2752
+ _HDRLoader._leftUpBack
2753
+ ];
2754
+ }(), function() {
2755
+ _HDRLoader._faceUp = [
2756
+ _HDRLoader._leftBottomFront,
2757
+ _HDRLoader._rightBottomFront,
2758
+ _HDRLoader._leftBottomBack,
2759
+ _HDRLoader._rightBottomBack
2760
+ ];
2761
+ }(), function() {
2762
+ _HDRLoader._faceBottom = [
2763
+ _HDRLoader._leftUpBack,
2764
+ _HDRLoader._rightUpBack,
2765
+ _HDRLoader._leftUpFront,
2766
+ _HDRLoader._rightUpFront
2767
+ ];
2768
+ }(), function() {
2769
+ _HDRLoader._faceFront = [
2770
+ _HDRLoader._leftBottomBack,
2771
+ _HDRLoader._rightBottomBack,
2772
+ _HDRLoader._leftUpBack,
2773
+ _HDRLoader._rightUpBack
2774
+ ];
2775
+ }(), function() {
2776
+ _HDRLoader._faceBack = [
2777
+ _HDRLoader._rightBottomFront,
2778
+ _HDRLoader._leftBottomFront,
2779
+ _HDRLoader._rightUpFront,
2780
+ _HDRLoader._leftUpFront
2781
+ ];
2782
+ }(), function() {
2783
+ _HDRLoader._tempVector3 = new Vector3();
2784
+ }(), function() {
2785
+ _HDRLoader._temp2Vector3 = new Vector3();
2786
+ }(), function() {
2787
+ _HDRLoader._temp3Vector3 = new Vector3();
2788
+ }(), function() {
2789
+ _HDRLoader._temp4Vector3 = new Vector3();
2790
+ }(), function() {
2791
+ _HDRLoader._temp5Vector3 = new Vector3();
2792
+ }(), _HDRLoader);
2763
2793
  HDRLoader = __decorate([
2764
2794
  resourceLoader(AssetType.HDR, [
2765
2795
  "hdr"
@@ -3129,19 +3159,21 @@ MaterialLoader = __decorate([
3129
3159
  ], MaterialLoader);
3130
3160
 
3131
3161
  function _defineProperties(target, props) {
3132
- for (var i = 0; i < props.length; i++) {
3133
- var descriptor = props[i];
3134
- descriptor.enumerable = descriptor.enumerable || false;
3135
- descriptor.configurable = true;
3136
- if ("value" in descriptor) descriptor.writable = true;
3137
- Object.defineProperty(target, descriptor.key, descriptor);
3138
- }
3162
+ for (var i = 0; i < props.length; i++) {
3163
+ var descriptor = props[i];
3164
+ descriptor.enumerable = descriptor.enumerable || false;
3165
+ descriptor.configurable = true;
3166
+
3167
+ if ("value" in descriptor) descriptor.writable = true;
3168
+
3169
+ Object.defineProperty(target, descriptor.key, descriptor);
3170
+ }
3139
3171
  }
3172
+ function _create_class(Constructor, protoProps, staticProps) {
3173
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
3174
+ if (staticProps) _defineProperties(Constructor, staticProps);
3140
3175
 
3141
- function _createClass(Constructor, protoProps, staticProps) {
3142
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
3143
- if (staticProps) _defineProperties(Constructor, staticProps);
3144
- return Constructor;
3176
+ return Constructor;
3145
3177
  }
3146
3178
 
3147
3179
  var BufferReader = /*#__PURE__*/ function() {
@@ -3250,7 +3282,7 @@ var BufferReader = /*#__PURE__*/ function() {
3250
3282
  if (byteLength < maxByteLength) this._offset++;
3251
3283
  return new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + byteOffset, byteLength);
3252
3284
  };
3253
- _createClass(BufferReader, [
3285
+ _create_class(BufferReader, [
3254
3286
  {
3255
3287
  key: "offset",
3256
3288
  get: function get() {
@@ -3260,12 +3292,14 @@ var BufferReader = /*#__PURE__*/ function() {
3260
3292
  ]);
3261
3293
  return BufferReader;
3262
3294
  }();
3263
- BufferReader.imageMapping = {
3264
- 0: "image/png",
3265
- 1: "image/jpg",
3266
- 2: "image/webp",
3267
- 3: "ktx"
3268
- };
3295
+ (function() {
3296
+ BufferReader.imageMapping = {
3297
+ 0: "image/png",
3298
+ 1: "image/jpg",
3299
+ 2: "image/webp",
3300
+ 3: "ktx"
3301
+ };
3302
+ })();
3269
3303
 
3270
3304
  var decoderMap = {};
3271
3305
  /**
@@ -3304,7 +3338,7 @@ var FileHeader = /*#__PURE__*/ function() {
3304
3338
  header.headerLength = nameUint8Array.byteLength + typeUint8Array.byteLength + 9;
3305
3339
  return header;
3306
3340
  };
3307
- _createClass(FileHeader, [
3341
+ _create_class(FileHeader, [
3308
3342
  {
3309
3343
  key: "dataLength",
3310
3344
  get: function get() {
@@ -3523,38 +3557,36 @@ Texture2DDecoder = __decorate([
3523
3557
  decoder("Texture2D")
3524
3558
  ], Texture2DDecoder);
3525
3559
 
3526
- function isNativeReflectConstruct() {
3527
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
3528
- if (Reflect.construct.sham) return false;
3529
- if (typeof Proxy === "function") return true;
3530
-
3531
- try {
3532
- Date.prototype.toString.call(Reflect.construct(Date, [], function () { }));
3533
- return true;
3534
- } catch (e) {
3535
- return false;
3536
- }
3537
- }
3560
+ function _is_native_reflect_construct() {
3561
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
3562
+ if (Reflect.construct.sham) return false;
3563
+ if (typeof Proxy === "function") return true;
3538
3564
 
3539
- function construct(Parent, args, Class) {
3540
- if (isNativeReflectConstruct()) {
3541
- construct = Reflect.construct;
3542
- } else {
3543
- construct = function construct(Parent, args, Class) {
3544
- var a = [null];
3545
- a.push.apply(a, args);
3546
- var Constructor = Function.bind.apply(Parent, a);
3547
- var instance = new Constructor();
3548
- if (Class) _setPrototypeOf(instance, Class.prototype);
3549
- return instance;
3550
- };
3551
- }
3565
+ try {
3566
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3552
3567
 
3553
- return construct.apply(null, arguments);
3568
+ return true;
3569
+ } catch (e) {
3570
+ return false;
3571
+ }
3554
3572
  }
3555
3573
 
3556
3574
  function _construct(Parent, args, Class) {
3557
- return construct.apply(null, arguments);
3575
+ if (_is_native_reflect_construct()) _construct = Reflect.construct;
3576
+ else {
3577
+ _construct = function construct(Parent, args, Class) {
3578
+ var a = [null];
3579
+ a.push.apply(a, args);
3580
+ var Constructor = Function.bind.apply(Parent, a);
3581
+ var instance = new Constructor();
3582
+
3583
+ if (Class) _set_prototype_of(instance, Class.prototype);
3584
+
3585
+ return instance;
3586
+ };
3587
+ }
3588
+
3589
+ return _construct.apply(null, arguments);
3558
3590
  }
3559
3591
 
3560
3592
  var ReflectionParser = /*#__PURE__*/ function() {
@@ -3669,7 +3701,9 @@ var ReflectionParser = /*#__PURE__*/ function() {
3669
3701
  };
3670
3702
  return ReflectionParser;
3671
3703
  }();
3672
- ReflectionParser.customParseComponentHandles = new Map();
3704
+ (function() {
3705
+ ReflectionParser.customParseComponentHandles = new Map();
3706
+ })();
3673
3707
 
3674
3708
  var PrefabParser = /*#__PURE__*/ function() {
3675
3709
  function PrefabParser() {}
@@ -3923,7 +3957,7 @@ var SceneParserContext = /*#__PURE__*/ function() {
3923
3957
  };
3924
3958
  _proto._organizeEntities = function _organizeEntities() {
3925
3959
  var _this_context = this.context, entityConfigMap = _this_context.entityConfigMap, entityMap = _this_context.entityMap, scene = _this_context.scene, rootIds = _this_context.rootIds;
3926
- for(var _iterator = _createForOfIteratorHelperLoose(rootIds), _step; !(_step = _iterator()).done;){
3960
+ for(var _iterator = _create_for_of_iterator_helper_loose(rootIds), _step; !(_step = _iterator()).done;){
3927
3961
  var rootId = _step.value;
3928
3962
  PrefabParser.parseChildren(entityConfigMap, entityMap, rootId);
3929
3963
  }
@@ -4087,7 +4121,7 @@ var SourceFontLoader = /*#__PURE__*/ function(Loader) {
4087
4121
  });
4088
4122
  };
4089
4123
  _proto._registerFont = function _registerFont(fontName, fontUrl) {
4090
- return _asyncToGenerator(function() {
4124
+ return _async_to_generator(function() {
4091
4125
  var fontFace;
4092
4126
  return __generator(this, function(_state) {
4093
4127
  switch(_state.label){
@@ -4408,7 +4442,7 @@ SceneLoader = __decorate([
4408
4442
  "prefab"
4409
4443
  ], true)
4410
4444
  ], SceneLoader);
4411
- ReflectionParser.registerCustomParseComponent("TextRenderer", /*#__PURE__*/ _asyncToGenerator(function(instance, item, engine) {
4445
+ ReflectionParser.registerCustomParseComponent("TextRenderer", /*#__PURE__*/ _async_to_generator(function(instance, item, engine) {
4412
4446
  var props;
4413
4447
  return __generator(this, function(_state) {
4414
4448
  props = item.props;