@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/main.js CHANGED
@@ -7,54 +7,37 @@ var engineMath = require('@galacean/engine-math');
7
7
  var engineDraco = require('@galacean/engine-draco');
8
8
  var engineRhiWebgl = require('@galacean/engine-rhi-webgl');
9
9
 
10
- function extends_() {
11
- extends_ = Object.assign || function (target) {
12
- for (var i = 1; i < arguments.length; i++) {
13
- var source = arguments[i];
14
-
15
- for (var key in source) {
16
- if (Object.prototype.hasOwnProperty.call(source, key)) {
17
- target[key] = source[key];
10
+ function _extends() {
11
+ _extends = Object.assign || function assign(target) {
12
+ for (var i = 1; i < arguments.length; i++) {
13
+ var source = arguments[i];
14
+ for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
18
15
  }
19
- }
20
- }
21
16
 
22
- return target;
23
- };
24
-
25
- return extends_.apply(this, arguments);
26
- }
17
+ return target;
18
+ };
27
19
 
28
- function _extends() {
29
- return extends_.apply(this, arguments);
20
+ return _extends.apply(this, arguments);
30
21
  }
31
22
 
32
- function setPrototypeOf(o, p) {
33
- setPrototypeOf = Object.setPrototypeOf || function setPrototypeOf(o, p) {
34
- o.__proto__ = p;
35
- return o;
36
- };
23
+ function _set_prototype_of(o, p) {
24
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
25
+ o.__proto__ = p;
37
26
 
38
- return setPrototypeOf(o, p);
39
- }
27
+ return o;
28
+ };
40
29
 
41
- function _setPrototypeOf(o, p) {
42
- return setPrototypeOf(o, p);
30
+ return _set_prototype_of(o, p);
43
31
  }
44
32
 
45
33
  function _inherits(subClass, superClass) {
46
- if (typeof superClass !== "function" && superClass !== null) {
47
- throw new TypeError("Super expression must either be null or a function");
48
- }
49
-
50
- subClass.prototype = Object.create(superClass && superClass.prototype, {
51
- constructor: {
52
- value: subClass,
53
- writable: true,
54
- configurable: true
34
+ if (typeof superClass !== "function" && superClass !== null) {
35
+ throw new TypeError("Super expression must either be null or a function");
55
36
  }
56
- });
57
- if (superClass) _setPrototypeOf(subClass, superClass);
37
+
38
+ subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
39
+
40
+ if (superClass) _set_prototype_of(subClass, superClass);
58
41
  }
59
42
 
60
43
  /******************************************************************************
@@ -270,39 +253,34 @@ EnvLoader = __decorate([
270
253
  ], EnvLoader);
271
254
 
272
255
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
273
- try {
274
- var info = gen[key](arg);
275
- var value = info.value;
276
- } catch (error) {
277
- reject(error);
278
- return;
279
- }
280
-
281
- if (info.done) {
282
- resolve(value);
283
- } else {
284
- Promise.resolve(value).then(_next, _throw);
285
- }
256
+ try {
257
+ var info = gen[key](arg);
258
+ var value = info.value;
259
+ } catch (error) {
260
+ reject(error);
261
+ return;
262
+ }
263
+ if (info.done) resolve(value);
264
+ else Promise.resolve(value).then(_next, _throw);
286
265
  }
266
+ function _async_to_generator(fn) {
267
+ return function() {
268
+ var self = this, args = arguments;
287
269
 
288
- function _asyncToGenerator(fn) {
289
- return function () {
290
- var self = this,
291
- args = arguments;
292
- return new Promise(function (resolve, reject) {
293
- var gen = fn.apply(self, args);
270
+ return new Promise(function(resolve, reject) {
271
+ var gen = fn.apply(self, args);
294
272
 
295
- function _next(value) {
296
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
297
- }
273
+ function _next(value) {
274
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
275
+ }
298
276
 
299
- function _throw(err) {
300
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
301
- }
277
+ function _throw(err) {
278
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
279
+ }
302
280
 
303
- _next(undefined);
304
- });
305
- };
281
+ _next(undefined);
282
+ });
283
+ };
306
284
  }
307
285
 
308
286
  var FontLoader = /*#__PURE__*/ function(Loader) {
@@ -335,7 +313,7 @@ var FontLoader = /*#__PURE__*/ function(Loader) {
335
313
  });
336
314
  };
337
315
  _proto._registerFont = function _registerFont(fontName, fontUrl) {
338
- return _asyncToGenerator(function() {
316
+ return _async_to_generator(function() {
339
317
  var fontFace;
340
318
  return __generator(this, function(_state) {
341
319
  switch(_state.label){
@@ -948,36 +926,41 @@ var TextureWrapMode;
948
926
  return GLTFUtil;
949
927
  }();
950
928
 
951
- function _arrayLikeToArray(arr, len) {
952
- if (len == null || len > arr.length) len = arr.length;
953
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
954
- return arr2;
929
+ function _array_like_to_array(arr, len) {
930
+ if (len == null || len > arr.length) len = arr.length;
931
+
932
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
933
+
934
+ return arr2;
955
935
  }
956
936
 
957
- function _arrayWithoutHoles(arr) {
958
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
937
+ function _array_without_holes(arr) {
938
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
959
939
  }
960
940
 
961
- function _iterableToArray(iter) {
962
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
941
+ function _iterable_to_array(iter) {
942
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
943
+ return Array.from(iter);
944
+ }
963
945
  }
964
946
 
965
- function _nonIterableSpread() {
966
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
947
+ function _non_iterable_spread() {
948
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
967
949
  }
968
950
 
969
- function _unsupportedIterableToArray(o, minLen) {
970
- if (!o) return;
971
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
972
- var n = Object.prototype.toString.call(o).slice(8, -1);
973
- if (n === "Object" && o.constructor) n = o.constructor.name;
974
- if (n === "Map" || n === "Set") return Array.from(n);
975
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
976
- return _arrayLikeToArray(o, minLen);
951
+ function _unsupported_iterable_to_array(o, minLen) {
952
+ if (!o) return;
953
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
954
+
955
+ var n = Object.prototype.toString.call(o).slice(8, -1);
956
+
957
+ if (n === "Object" && o.constructor) n = o.constructor.name;
958
+ if (n === "Map" || n === "Set") return Array.from(n);
959
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
977
960
  }
978
961
 
979
- function _toConsumableArray(arr) {
980
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
962
+ function _to_consumable_array(arr) {
963
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
981
964
  }
982
965
 
983
966
  var Parser = /*#__PURE__*/ function() {
@@ -994,7 +977,7 @@ var Parser = /*#__PURE__*/ function() {
994
977
  extensionSchema,
995
978
  parseResource,
996
979
  context
997
- ].concat(_toConsumableArray(extra)));
980
+ ].concat(_to_consumable_array(extra)));
998
981
  }
999
982
  }
1000
983
  };
@@ -1008,7 +991,7 @@ var Parser = /*#__PURE__*/ function() {
1008
991
  return (_parsers_ = parsers[0]).createEngineResource.apply(_parsers_, [
1009
992
  extensionSchema,
1010
993
  context
1011
- ].concat(_toConsumableArray(extra)));
994
+ ].concat(_to_consumable_array(extra)));
1012
995
  }
1013
996
  };
1014
997
  Parser.hasExtensionParser = function hasExtensionParser(extensionName) {
@@ -1033,7 +1016,9 @@ var Parser = /*#__PURE__*/ function() {
1033
1016
  };
1034
1017
  return Parser;
1035
1018
  }();
1036
- Parser._extensionParsers = {};
1019
+ (function() {
1020
+ Parser._extensionParsers = {};
1021
+ })();
1037
1022
  /**
1038
1023
  * Declare ExtensionParser's decorator.
1039
1024
  * @param extensionName - Extension name
@@ -1108,11 +1093,9 @@ KHR_draco_mesh_compression = __decorate([
1108
1093
  ], KHR_draco_mesh_compression);
1109
1094
 
1110
1095
  function _instanceof(left, right) {
1111
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
1112
- return !!right[Symbol.hasInstance](left);
1113
- } else {
1114
- return left instanceof right;
1115
- }
1096
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
1097
+ return !!right[Symbol.hasInstance](left);
1098
+ } else return left instanceof right;
1116
1099
  }
1117
1100
 
1118
1101
  var KHR_lights_punctual = /*#__PURE__*/ function(ExtensionParser) {
@@ -1435,23 +1418,24 @@ GalaceanMaterialsRemap = __decorate([
1435
1418
  registerExtension("OASIS_materials_remap")
1436
1419
  ], GalaceanMaterialsRemap);
1437
1420
 
1438
- function _createForOfIteratorHelperLoose(o, allowArrayLike) {
1421
+ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1439
1422
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
1423
+
1440
1424
  if (it) return (it = it.call(o)).next.bind(it);
1441
1425
  // Fallback for engines without symbol support
1442
- if (
1443
- Array.isArray(o) ||
1444
- (it = _unsupportedIterableToArray(o)) ||
1445
- (allowArrayLike && o && typeof o.length === "number")
1446
- ) {
1426
+ if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === "number") {
1447
1427
  if (it) o = it;
1428
+
1448
1429
  var i = 0;
1449
- return function () {
1430
+
1431
+ return function() {
1450
1432
  if (i >= o.length) return { done: true };
1433
+
1451
1434
  return { done: false, value: o[i++] };
1452
- }
1435
+ };
1453
1436
  }
1454
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1437
+
1438
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1455
1439
  }
1456
1440
 
1457
1441
  var AnimationParser = /*#__PURE__*/ function(Parser) {
@@ -1744,7 +1728,9 @@ var EntityParser = /*#__PURE__*/ function(Parser) {
1744
1728
  };
1745
1729
  return EntityParser;
1746
1730
  }(Parser);
1747
- /** @internal */ EntityParser._defaultName = "_GLTF_ENTITY_";
1731
+ (function() {
1732
+ /** @internal */ EntityParser._defaultName = "_GLTF_ENTITY_";
1733
+ })();
1748
1734
 
1749
1735
  var MeshParser = /*#__PURE__*/ function(Parser1) {
1750
1736
  _inherits(MeshParser, Parser1);
@@ -2026,7 +2012,9 @@ var MeshParser = /*#__PURE__*/ function(Parser1) {
2026
2012
  };
2027
2013
  return MeshParser;
2028
2014
  }(Parser);
2029
- MeshParser._tempVector3 = new engineMath.Vector3();
2015
+ (function() {
2016
+ MeshParser._tempVector3 = new engineMath.Vector3();
2017
+ })();
2030
2018
 
2031
2019
  var SceneParser$1 = /*#__PURE__*/ function(Parser1) {
2032
2020
  _inherits(SceneParser, Parser1);
@@ -2235,7 +2223,7 @@ var SkinParser = /*#__PURE__*/ function(Parser) {
2235
2223
  };
2236
2224
  _proto._findSkeletonRootBone = function _findSkeletonRootBone(joints, entities) {
2237
2225
  var paths = {};
2238
- for(var _iterator = _createForOfIteratorHelperLoose(joints), _step; !(_step = _iterator()).done;){
2226
+ for(var _iterator = _create_for_of_iterator_helper_loose(joints), _step; !(_step = _iterator()).done;){
2239
2227
  var index = _step.value;
2240
2228
  var path = new Array();
2241
2229
  var entity = entities[index];
@@ -2337,8 +2325,10 @@ var TextureParser = /*#__PURE__*/ function(Parser) {
2337
2325
  };
2338
2326
  return TextureParser;
2339
2327
  }(Parser);
2340
- var _obj;
2341
- TextureParser._wrapMap = (_obj = {}, _obj[TextureWrapMode.CLAMP_TO_EDGE] = engineCore.TextureWrapMode.Clamp, _obj[TextureWrapMode.MIRRORED_REPEAT] = engineCore.TextureWrapMode.Mirror, _obj[TextureWrapMode.REPEAT] = engineCore.TextureWrapMode.Repeat, _obj);
2328
+ (function() {
2329
+ var _obj;
2330
+ TextureParser._wrapMap = (_obj = {}, _obj[TextureWrapMode.CLAMP_TO_EDGE] = engineCore.TextureWrapMode.Clamp, _obj[TextureWrapMode.MIRRORED_REPEAT] = engineCore.TextureWrapMode.Mirror, _obj[TextureWrapMode.REPEAT] = engineCore.TextureWrapMode.Repeat, _obj);
2331
+ })();
2342
2332
 
2343
2333
  var Validator = /*#__PURE__*/ function(Parser1) {
2344
2334
  _inherits(Validator, Parser1);
@@ -2410,17 +2400,19 @@ var GLTFParser = /*#__PURE__*/ function() {
2410
2400
  };
2411
2401
  return GLTFParser;
2412
2402
  }();
2413
- GLTFParser.defaultPipeline = new GLTFParser([
2414
- BufferParser,
2415
- Validator,
2416
- TextureParser,
2417
- MaterialParser,
2418
- MeshParser,
2419
- EntityParser,
2420
- SkinParser,
2421
- AnimationParser,
2422
- SceneParser$1
2423
- ]);
2403
+ (function() {
2404
+ GLTFParser.defaultPipeline = new GLTFParser([
2405
+ BufferParser,
2406
+ Validator,
2407
+ TextureParser,
2408
+ MaterialParser,
2409
+ MeshParser,
2410
+ EntityParser,
2411
+ SkinParser,
2412
+ AnimationParser,
2413
+ SceneParser$1
2414
+ ]);
2415
+ })();
2424
2416
 
2425
2417
  /**
2426
2418
  * Product after GLTF parser, usually, `defaultSceneRoot` is only needed to use.
@@ -2472,7 +2464,7 @@ var GLTFLoader = /*#__PURE__*/ function(Loader) {
2472
2464
  context.keepMeshData = (_item_params_keepMeshData = (_item_params = item.params) == null ? void 0 : _item_params.keepMeshData) != null ? _item_params_keepMeshData : false;
2473
2465
  masterPromiseInfo.onCancel(function() {
2474
2466
  var chainPromises = context.chainPromises;
2475
- for(var _iterator = _createForOfIteratorHelperLoose(chainPromises), _step; !(_step = _iterator()).done;){
2467
+ for(var _iterator = _create_for_of_iterator_helper_loose(chainPromises), _step; !(_step = _iterator()).done;){
2476
2468
  var promise = _step.value;
2477
2469
  promise.cancel();
2478
2470
  }
@@ -2733,37 +2725,75 @@ var HDRLoader = (_HDRLoader = /*#__PURE__*/ function(Loader) {
2733
2725
  color.a *= M;
2734
2726
  };
2735
2727
  return HDRLoader1;
2736
- }(engineCore.Loader), _HDRLoader._rightBottomBack = new engineMath.Vector3(1.0, -1.0, -1.0), _HDRLoader._rightBottomFront = new engineMath.Vector3(1.0, -1.0, 1.0), _HDRLoader._rightUpBack = new engineMath.Vector3(1.0, 1.0, -1.0), _HDRLoader._rightUpFront = new engineMath.Vector3(1.0, 1.0, 1.0), _HDRLoader._leftBottomBack = new engineMath.Vector3(-1.0, -1.0, -1.0), _HDRLoader._leftBottomFront = new engineMath.Vector3(-1.0, -1.0, 1.0), _HDRLoader._leftUpBack = new engineMath.Vector3(-1.0, 1.0, -1.0), _HDRLoader._leftUpFront = new engineMath.Vector3(-1.0, 1.0, 1.0), _HDRLoader._faceRight = [
2737
- _HDRLoader._rightBottomBack,
2738
- _HDRLoader._rightBottomFront,
2739
- _HDRLoader._rightUpBack,
2740
- _HDRLoader._rightUpFront
2741
- ], _HDRLoader._faceLeft = [
2742
- _HDRLoader._leftBottomFront,
2743
- _HDRLoader._leftBottomBack,
2744
- _HDRLoader._leftUpFront,
2745
- _HDRLoader._leftUpBack
2746
- ], _HDRLoader._faceUp = [
2747
- _HDRLoader._leftBottomFront,
2748
- _HDRLoader._rightBottomFront,
2749
- _HDRLoader._leftBottomBack,
2750
- _HDRLoader._rightBottomBack
2751
- ], _HDRLoader._faceBottom = [
2752
- _HDRLoader._leftUpBack,
2753
- _HDRLoader._rightUpBack,
2754
- _HDRLoader._leftUpFront,
2755
- _HDRLoader._rightUpFront
2756
- ], _HDRLoader._faceFront = [
2757
- _HDRLoader._leftBottomBack,
2758
- _HDRLoader._rightBottomBack,
2759
- _HDRLoader._leftUpBack,
2760
- _HDRLoader._rightUpBack
2761
- ], _HDRLoader._faceBack = [
2762
- _HDRLoader._rightBottomFront,
2763
- _HDRLoader._leftBottomFront,
2764
- _HDRLoader._rightUpFront,
2765
- _HDRLoader._leftUpFront
2766
- ], _HDRLoader._tempVector3 = new engineMath.Vector3(), _HDRLoader._temp2Vector3 = new engineMath.Vector3(), _HDRLoader._temp3Vector3 = new engineMath.Vector3(), _HDRLoader._temp4Vector3 = new engineMath.Vector3(), _HDRLoader._temp5Vector3 = new engineMath.Vector3(), _HDRLoader);
2728
+ }(engineCore.Loader), function() {
2729
+ _HDRLoader._rightBottomBack = new engineMath.Vector3(1.0, -1.0, -1.0);
2730
+ }(), function() {
2731
+ _HDRLoader._rightBottomFront = new engineMath.Vector3(1.0, -1.0, 1.0);
2732
+ }(), function() {
2733
+ _HDRLoader._rightUpBack = new engineMath.Vector3(1.0, 1.0, -1.0);
2734
+ }(), function() {
2735
+ _HDRLoader._rightUpFront = new engineMath.Vector3(1.0, 1.0, 1.0);
2736
+ }(), function() {
2737
+ _HDRLoader._leftBottomBack = new engineMath.Vector3(-1.0, -1.0, -1.0);
2738
+ }(), function() {
2739
+ _HDRLoader._leftBottomFront = new engineMath.Vector3(-1.0, -1.0, 1.0);
2740
+ }(), function() {
2741
+ _HDRLoader._leftUpBack = new engineMath.Vector3(-1.0, 1.0, -1.0);
2742
+ }(), function() {
2743
+ _HDRLoader._leftUpFront = new engineMath.Vector3(-1.0, 1.0, 1.0);
2744
+ }(), function() {
2745
+ _HDRLoader._faceRight = [
2746
+ _HDRLoader._rightBottomBack,
2747
+ _HDRLoader._rightBottomFront,
2748
+ _HDRLoader._rightUpBack,
2749
+ _HDRLoader._rightUpFront
2750
+ ];
2751
+ }(), function() {
2752
+ _HDRLoader._faceLeft = [
2753
+ _HDRLoader._leftBottomFront,
2754
+ _HDRLoader._leftBottomBack,
2755
+ _HDRLoader._leftUpFront,
2756
+ _HDRLoader._leftUpBack
2757
+ ];
2758
+ }(), function() {
2759
+ _HDRLoader._faceUp = [
2760
+ _HDRLoader._leftBottomFront,
2761
+ _HDRLoader._rightBottomFront,
2762
+ _HDRLoader._leftBottomBack,
2763
+ _HDRLoader._rightBottomBack
2764
+ ];
2765
+ }(), function() {
2766
+ _HDRLoader._faceBottom = [
2767
+ _HDRLoader._leftUpBack,
2768
+ _HDRLoader._rightUpBack,
2769
+ _HDRLoader._leftUpFront,
2770
+ _HDRLoader._rightUpFront
2771
+ ];
2772
+ }(), function() {
2773
+ _HDRLoader._faceFront = [
2774
+ _HDRLoader._leftBottomBack,
2775
+ _HDRLoader._rightBottomBack,
2776
+ _HDRLoader._leftUpBack,
2777
+ _HDRLoader._rightUpBack
2778
+ ];
2779
+ }(), function() {
2780
+ _HDRLoader._faceBack = [
2781
+ _HDRLoader._rightBottomFront,
2782
+ _HDRLoader._leftBottomFront,
2783
+ _HDRLoader._rightUpFront,
2784
+ _HDRLoader._leftUpFront
2785
+ ];
2786
+ }(), function() {
2787
+ _HDRLoader._tempVector3 = new engineMath.Vector3();
2788
+ }(), function() {
2789
+ _HDRLoader._temp2Vector3 = new engineMath.Vector3();
2790
+ }(), function() {
2791
+ _HDRLoader._temp3Vector3 = new engineMath.Vector3();
2792
+ }(), function() {
2793
+ _HDRLoader._temp4Vector3 = new engineMath.Vector3();
2794
+ }(), function() {
2795
+ _HDRLoader._temp5Vector3 = new engineMath.Vector3();
2796
+ }(), _HDRLoader);
2767
2797
  HDRLoader = __decorate([
2768
2798
  engineCore.resourceLoader(engineCore.AssetType.HDR, [
2769
2799
  "hdr"
@@ -3133,19 +3163,21 @@ MaterialLoader = __decorate([
3133
3163
  ], MaterialLoader);
3134
3164
 
3135
3165
  function _defineProperties(target, props) {
3136
- for (var i = 0; i < props.length; i++) {
3137
- var descriptor = props[i];
3138
- descriptor.enumerable = descriptor.enumerable || false;
3139
- descriptor.configurable = true;
3140
- if ("value" in descriptor) descriptor.writable = true;
3141
- Object.defineProperty(target, descriptor.key, descriptor);
3142
- }
3166
+ for (var i = 0; i < props.length; i++) {
3167
+ var descriptor = props[i];
3168
+ descriptor.enumerable = descriptor.enumerable || false;
3169
+ descriptor.configurable = true;
3170
+
3171
+ if ("value" in descriptor) descriptor.writable = true;
3172
+
3173
+ Object.defineProperty(target, descriptor.key, descriptor);
3174
+ }
3143
3175
  }
3176
+ function _create_class(Constructor, protoProps, staticProps) {
3177
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
3178
+ if (staticProps) _defineProperties(Constructor, staticProps);
3144
3179
 
3145
- function _createClass(Constructor, protoProps, staticProps) {
3146
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
3147
- if (staticProps) _defineProperties(Constructor, staticProps);
3148
- return Constructor;
3180
+ return Constructor;
3149
3181
  }
3150
3182
 
3151
3183
  var BufferReader = /*#__PURE__*/ function() {
@@ -3254,7 +3286,7 @@ var BufferReader = /*#__PURE__*/ function() {
3254
3286
  if (byteLength < maxByteLength) this._offset++;
3255
3287
  return new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + byteOffset, byteLength);
3256
3288
  };
3257
- _createClass(BufferReader, [
3289
+ _create_class(BufferReader, [
3258
3290
  {
3259
3291
  key: "offset",
3260
3292
  get: function get() {
@@ -3264,12 +3296,14 @@ var BufferReader = /*#__PURE__*/ function() {
3264
3296
  ]);
3265
3297
  return BufferReader;
3266
3298
  }();
3267
- BufferReader.imageMapping = {
3268
- 0: "image/png",
3269
- 1: "image/jpg",
3270
- 2: "image/webp",
3271
- 3: "ktx"
3272
- };
3299
+ (function() {
3300
+ BufferReader.imageMapping = {
3301
+ 0: "image/png",
3302
+ 1: "image/jpg",
3303
+ 2: "image/webp",
3304
+ 3: "ktx"
3305
+ };
3306
+ })();
3273
3307
 
3274
3308
  var decoderMap = {};
3275
3309
  /**
@@ -3308,7 +3342,7 @@ var FileHeader = /*#__PURE__*/ function() {
3308
3342
  header.headerLength = nameUint8Array.byteLength + typeUint8Array.byteLength + 9;
3309
3343
  return header;
3310
3344
  };
3311
- _createClass(FileHeader, [
3345
+ _create_class(FileHeader, [
3312
3346
  {
3313
3347
  key: "dataLength",
3314
3348
  get: function get() {
@@ -3527,38 +3561,36 @@ exports.Texture2DDecoder = __decorate([
3527
3561
  decoder("Texture2D")
3528
3562
  ], exports.Texture2DDecoder);
3529
3563
 
3530
- function isNativeReflectConstruct() {
3531
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
3532
- if (Reflect.construct.sham) return false;
3533
- if (typeof Proxy === "function") return true;
3534
-
3535
- try {
3536
- Date.prototype.toString.call(Reflect.construct(Date, [], function () { }));
3537
- return true;
3538
- } catch (e) {
3539
- return false;
3540
- }
3541
- }
3564
+ function _is_native_reflect_construct() {
3565
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
3566
+ if (Reflect.construct.sham) return false;
3567
+ if (typeof Proxy === "function") return true;
3542
3568
 
3543
- function construct(Parent, args, Class) {
3544
- if (isNativeReflectConstruct()) {
3545
- construct = Reflect.construct;
3546
- } else {
3547
- construct = function construct(Parent, args, Class) {
3548
- var a = [null];
3549
- a.push.apply(a, args);
3550
- var Constructor = Function.bind.apply(Parent, a);
3551
- var instance = new Constructor();
3552
- if (Class) _setPrototypeOf(instance, Class.prototype);
3553
- return instance;
3554
- };
3555
- }
3569
+ try {
3570
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3556
3571
 
3557
- return construct.apply(null, arguments);
3572
+ return true;
3573
+ } catch (e) {
3574
+ return false;
3575
+ }
3558
3576
  }
3559
3577
 
3560
3578
  function _construct(Parent, args, Class) {
3561
- return construct.apply(null, arguments);
3579
+ if (_is_native_reflect_construct()) _construct = Reflect.construct;
3580
+ else {
3581
+ _construct = function construct(Parent, args, Class) {
3582
+ var a = [null];
3583
+ a.push.apply(a, args);
3584
+ var Constructor = Function.bind.apply(Parent, a);
3585
+ var instance = new Constructor();
3586
+
3587
+ if (Class) _set_prototype_of(instance, Class.prototype);
3588
+
3589
+ return instance;
3590
+ };
3591
+ }
3592
+
3593
+ return _construct.apply(null, arguments);
3562
3594
  }
3563
3595
 
3564
3596
  var ReflectionParser = /*#__PURE__*/ function() {
@@ -3673,7 +3705,9 @@ var ReflectionParser = /*#__PURE__*/ function() {
3673
3705
  };
3674
3706
  return ReflectionParser;
3675
3707
  }();
3676
- ReflectionParser.customParseComponentHandles = new Map();
3708
+ (function() {
3709
+ ReflectionParser.customParseComponentHandles = new Map();
3710
+ })();
3677
3711
 
3678
3712
  var PrefabParser = /*#__PURE__*/ function() {
3679
3713
  function PrefabParser() {}
@@ -3927,7 +3961,7 @@ var SceneParserContext = /*#__PURE__*/ function() {
3927
3961
  };
3928
3962
  _proto._organizeEntities = function _organizeEntities() {
3929
3963
  var _this_context = this.context, entityConfigMap = _this_context.entityConfigMap, entityMap = _this_context.entityMap, scene = _this_context.scene, rootIds = _this_context.rootIds;
3930
- for(var _iterator = _createForOfIteratorHelperLoose(rootIds), _step; !(_step = _iterator()).done;){
3964
+ for(var _iterator = _create_for_of_iterator_helper_loose(rootIds), _step; !(_step = _iterator()).done;){
3931
3965
  var rootId = _step.value;
3932
3966
  PrefabParser.parseChildren(entityConfigMap, entityMap, rootId);
3933
3967
  }
@@ -4091,7 +4125,7 @@ var SourceFontLoader = /*#__PURE__*/ function(Loader) {
4091
4125
  });
4092
4126
  };
4093
4127
  _proto._registerFont = function _registerFont(fontName, fontUrl) {
4094
- return _asyncToGenerator(function() {
4128
+ return _async_to_generator(function() {
4095
4129
  var fontFace;
4096
4130
  return __generator(this, function(_state) {
4097
4131
  switch(_state.label){
@@ -4412,7 +4446,7 @@ SceneLoader = __decorate([
4412
4446
  "prefab"
4413
4447
  ], true)
4414
4448
  ], SceneLoader);
4415
- ReflectionParser.registerCustomParseComponent("TextRenderer", /*#__PURE__*/ _asyncToGenerator(function(instance, item, engine) {
4449
+ ReflectionParser.registerCustomParseComponent("TextRenderer", /*#__PURE__*/ _async_to_generator(function(instance, item, engine) {
4416
4450
  var props;
4417
4451
  return __generator(this, function(_state) {
4418
4452
  props = item.props;