@galacean/engine-loader 1.1.0-alpha.3 → 1.1.0-beta.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
@@ -1,4 +1,4 @@
1
- import { Utils, ModelMesh, BlendShape, Texture2D, Entity, Loader, Transform, Animator, DirectLight, Camera, MeshRenderer, ParticleRenderer, PointLight, SpotLight, Script, SpriteMask, SpriteRenderer, TextRenderer, AnimationClip, AnimationEvent, AnimationQuaternionCurve, Keyframe, AnimationColorCurve, AnimationVector4Curve, AnimationVector3Curve, AnimationVector2Curve, AnimationFloatArrayCurve, AnimationArrayCurve, AnimationFloatCurve, Scene, resourceLoader, AssetPromise, AssetType, AnimatorController, AnimatorControllerLayer, AnimatorStateMachine, AnimatorStateTransition, TextureCube, TextureFilterMode, TextureCubeFace, AmbientLight, DiffuseMode, Font, ReferResource, IndexFormat, VertexElementFormat, GLCapabilityType, Logger, TextureFormat, request, ContentRestorer, InterpolationType, SkinnedMeshRenderer, PBRMaterial, BlinnPhongMaterial, PBRSpecularMaterial, TextureCoordinate, RenderFace, VertexElement, Buffer, BufferBindFlag, BufferUsage, Skin, TextureWrapMode as TextureWrapMode$1, Material, Shader, SpriteAtlas, Sprite, BackgroundMode, UnlitMaterial } from '@galacean/engine-core';
1
+ import { Utils, ModelMesh, BlendShape, Texture2D, Entity, Loader, Transform, Animator, DirectLight, Camera, MeshRenderer, ParticleRenderer, PointLight, SpotLight, Script, SpriteMask, SpriteRenderer, TextRenderer, AnimationClip, AnimationEvent, AnimationRefCurve, Keyframe, AnimationQuaternionCurve, AnimationColorCurve, AnimationVector4Curve, AnimationVector3Curve, AnimationVector2Curve, AnimationFloatArrayCurve, AnimationArrayCurve, AnimationFloatCurve, Scene, resourceLoader, AssetPromise, AssetType, AnimatorController, AnimatorControllerLayer, AnimatorStateMachine, AnimatorStateTransition, TextureCube, TextureFilterMode, TextureCubeFace, AmbientLight, DiffuseMode, Font, ReferResource, IndexFormat, VertexElementFormat, GLCapabilityType, Logger, TextureFormat, request, ContentRestorer, InterpolationType, SkinnedMeshRenderer, PBRMaterial, BlinnPhongMaterial, PBRSpecularMaterial, TextureCoordinate, RenderFace, VertexElement, Buffer, BufferBindFlag, BufferUsage, Skin, TextureWrapMode as TextureWrapMode$1, Material, Shader, SpriteAtlas, Sprite, BackgroundMode, UnlitMaterial } from '@galacean/engine-core';
2
2
  import { Color, Vector4, Vector3, Vector2, Quaternion, SphericalHarmonics3, MathUtil, BoundingBox, Matrix, Rect } from '@galacean/engine-math';
3
3
  import { GLCompressedTextureInternalFormat } from '@galacean/engine-rhi-webgl';
4
4
  import { DRACODecoder } from '@galacean/engine-draco';
@@ -36,56 +36,61 @@ function _inherits(subClass, superClass) {
36
36
  if (superClass) _set_prototype_of(subClass, superClass);
37
37
  }
38
38
 
39
- /******************************************************************************
40
- Copyright (c) Microsoft Corporation.
41
-
42
- Permission to use, copy, modify, and/or distribute this software for any
43
- purpose with or without fee is hereby granted.
44
-
45
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
46
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
47
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
48
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
49
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
50
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
51
- PERFORMANCE OF THIS SOFTWARE.
52
- ***************************************************************************** */
53
-
54
- function __decorate(decorators, target, key, desc) {
55
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
56
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
57
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
58
- return c > 3 && r && Object.defineProperty(target, key, r), r;
59
- }
60
-
61
- function __generator(thisArg, body) {
62
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
63
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
64
- function verb(n) { return function (v) { return step([n, v]); }; }
65
- function step(op) {
66
- if (f) throw new TypeError("Generator is already executing.");
67
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
68
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
69
- if (y = 0, t) op = [op[0] & 2, t.value];
70
- switch (op[0]) {
71
- case 0: case 1: t = op; break;
72
- case 4: _.label++; return { value: op[1], done: false };
73
- case 5: _.label++; y = op[1]; op = [0]; continue;
74
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
75
- default:
76
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
77
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
78
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
79
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
80
- if (t[2]) _.ops.pop();
81
- _.trys.pop(); continue;
82
- }
83
- op = body.call(thisArg, _);
84
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
85
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
86
- }
39
+ /******************************************************************************
40
+ Copyright (c) Microsoft Corporation.
41
+
42
+ Permission to use, copy, modify, and/or distribute this software for any
43
+ purpose with or without fee is hereby granted.
44
+
45
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
46
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
47
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
48
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
49
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
50
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
51
+ PERFORMANCE OF THIS SOFTWARE.
52
+ ***************************************************************************** */
53
+
54
+ function __decorate(decorators, target, key, desc) {
55
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
56
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
57
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
58
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
87
59
  }
88
60
 
61
+ function __generator(thisArg, body) {
62
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
63
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
64
+ function verb(n) { return function (v) { return step([n, v]); }; }
65
+ function step(op) {
66
+ if (f) throw new TypeError("Generator is already executing.");
67
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
68
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
69
+ if (y = 0, t) op = [op[0] & 2, t.value];
70
+ switch (op[0]) {
71
+ case 0: case 1: t = op; break;
72
+ case 4: _.label++; return { value: op[1], done: false };
73
+ case 5: _.label++; y = op[1]; op = [0]; continue;
74
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
75
+ default:
76
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
77
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
78
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
79
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
80
+ if (t[2]) _.ops.pop();
81
+ _.trys.pop(); continue;
82
+ }
83
+ op = body.call(thisArg, _);
84
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
85
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
86
+ }
87
+ }
88
+
89
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
90
+ var e = new Error(message);
91
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
92
+ };
93
+
89
94
  function _defineProperties(target, props) {
90
95
  for (var i = 0; i < props.length; i++) {
91
96
  var descriptor = props[i];
@@ -618,7 +623,7 @@ var ReflectionParser = /*#__PURE__*/ function() {
618
623
  return _this.parseBasicType(param, engine, resourceManager);
619
624
  })).then(function(result) {
620
625
  var _instance;
621
- return (_instance = instance)[methodName].apply(_instance, result);
626
+ return (_instance = instance)[methodName].apply(_instance, [].concat(result));
622
627
  });
623
628
  };
624
629
  ReflectionParser._isClass = function _isClass(value) {
@@ -676,6 +681,8 @@ var InterpolableValueType;
676
681
  InterpolableValueType[InterpolableValueType["Color"] = 6] = "Color";
677
682
  InterpolableValueType[InterpolableValueType["Array"] = 7] = "Array";
678
683
  InterpolableValueType[InterpolableValueType["Boolean"] = 8] = "Boolean";
684
+ InterpolableValueType[InterpolableValueType["Rect"] = 9] = "Rect";
685
+ InterpolableValueType[InterpolableValueType["ReferResource"] = 10] = "ReferResource";
679
686
  })(InterpolableValueType || (InterpolableValueType = {}));
680
687
  var AnimationClipDecoder = /*#__PURE__*/ function() {
681
688
  function AnimationClipDecoder() {}
@@ -704,7 +711,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
704
711
  switch(curveType){
705
712
  case "AnimationFloatCurve":
706
713
  {
707
- curve = curve || new AnimationFloatCurve();
714
+ curve = new AnimationFloatCurve();
708
715
  curve.interpolation = interpolation;
709
716
  for(var j = 0; j < keysLen; ++j){
710
717
  var keyframe = new Keyframe();
@@ -718,7 +725,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
718
725
  }
719
726
  case "AnimationArrayCurve":
720
727
  {
721
- curve = curve || new AnimationArrayCurve();
728
+ curve = new AnimationArrayCurve();
722
729
  curve.interpolation = interpolation;
723
730
  for(var j1 = 0; j1 < keysLen; ++j1){
724
731
  var keyframe1 = new Keyframe();
@@ -733,7 +740,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
733
740
  }
734
741
  case "AnimationFloatArrayCurve":
735
742
  {
736
- curve = curve || new AnimationFloatArrayCurve();
743
+ curve = new AnimationFloatArrayCurve();
737
744
  curve.interpolation = interpolation;
738
745
  for(var j2 = 0; j2 < keysLen; ++j2){
739
746
  var keyframe2 = new Keyframe();
@@ -748,7 +755,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
748
755
  }
749
756
  case "AnimationVector2Curve":
750
757
  {
751
- curve = curve || new AnimationVector2Curve();
758
+ curve = new AnimationVector2Curve();
752
759
  curve.interpolation = interpolation;
753
760
  for(var j3 = 0; j3 < keysLen; ++j3){
754
761
  var keyframe3 = new Keyframe();
@@ -762,7 +769,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
762
769
  }
763
770
  case "AnimationVector3Curve":
764
771
  {
765
- curve = curve || new AnimationVector3Curve();
772
+ curve = new AnimationVector3Curve();
766
773
  curve.interpolation = interpolation;
767
774
  for(var j4 = 0; j4 < keysLen; ++j4){
768
775
  var keyframe4 = new Keyframe();
@@ -776,7 +783,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
776
783
  }
777
784
  case "AnimationVector4Curve":
778
785
  {
779
- curve = curve || new AnimationVector4Curve();
786
+ curve = new AnimationVector4Curve();
780
787
  curve.interpolation = interpolation;
781
788
  var keyframe5 = new Keyframe();
782
789
  keyframe5.time = bufferReader.nextFloat32();
@@ -788,7 +795,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
788
795
  }
789
796
  case "AnimationColorCurve":
790
797
  {
791
- curve = curve || new AnimationColorCurve();
798
+ curve = new AnimationColorCurve();
792
799
  curve.interpolation = interpolation;
793
800
  for(var j5 = 0; j5 < keysLen; ++j5){
794
801
  var keyframe6 = new Keyframe();
@@ -802,7 +809,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
802
809
  }
803
810
  case "AnimationQuaternionCurve":
804
811
  {
805
- curve = curve || new AnimationQuaternionCurve();
812
+ curve = new AnimationQuaternionCurve();
806
813
  curve.interpolation = interpolation;
807
814
  for(var j6 = 0; j6 < keysLen; ++j6){
808
815
  var keyframe7 = new Keyframe();
@@ -814,6 +821,18 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
814
821
  }
815
822
  break;
816
823
  }
824
+ case "AnimationRefCurve":
825
+ {
826
+ curve = new AnimationRefCurve();
827
+ curve.interpolation = interpolation;
828
+ for(var j7 = 0; j7 < keysLen; ++j7){
829
+ var keyframe8 = new Keyframe();
830
+ keyframe8.time = bufferReader.nextFloat32();
831
+ keyframe8.value = JSON.parse(bufferReader.nextStr());
832
+ curve.addKey(keyframe8);
833
+ }
834
+ break;
835
+ }
817
836
  }
818
837
  clip.addCurveBinding(relativePath, componentType, property, curve);
819
838
  }
@@ -983,10 +1002,10 @@ var SceneParserContext = /*#__PURE__*/ function() {
983
1002
  return SceneParser;
984
1003
  }();
985
1004
 
986
- var MeshLoader$1 = /*#__PURE__*/ function(Loader) {
987
- _inherits(MeshLoader, Loader);
1005
+ var MeshLoader$1 = /*#__PURE__*/ function(Loader1) {
1006
+ _inherits(MeshLoader, Loader1);
988
1007
  function MeshLoader() {
989
- return Loader.apply(this, arguments);
1008
+ return Loader1.apply(this, arguments);
990
1009
  }
991
1010
  var _proto = MeshLoader.prototype;
992
1011
  _proto.load = function load(item, resourceManager) {
@@ -1009,10 +1028,10 @@ MeshLoader$1 = __decorate([
1009
1028
  ], true)
1010
1029
  ], MeshLoader$1);
1011
1030
 
1012
- var EditorTextureLoader = /*#__PURE__*/ function(Loader) {
1013
- _inherits(EditorTextureLoader, Loader);
1031
+ var EditorTextureLoader = /*#__PURE__*/ function(Loader1) {
1032
+ _inherits(EditorTextureLoader, Loader1);
1014
1033
  function EditorTextureLoader() {
1015
- return Loader.apply(this, arguments);
1034
+ return Loader1.apply(this, arguments);
1016
1035
  }
1017
1036
  var _proto = EditorTextureLoader.prototype;
1018
1037
  _proto.load = function load(item, resourceManager) {
@@ -1049,10 +1068,10 @@ EditorTextureLoader = __decorate([
1049
1068
  });
1050
1069
  }
1051
1070
 
1052
- var AnimationClipLoader = /*#__PURE__*/ function(Loader) {
1053
- _inherits(AnimationClipLoader, Loader);
1071
+ var AnimationClipLoader = /*#__PURE__*/ function(Loader1) {
1072
+ _inherits(AnimationClipLoader, Loader1);
1054
1073
  function AnimationClipLoader() {
1055
- return Loader.apply(this, arguments);
1074
+ return Loader1.apply(this, arguments);
1056
1075
  }
1057
1076
  var _proto = AnimationClipLoader.prototype;
1058
1077
  _proto.load = function load(item, resourceManager) {
@@ -1061,7 +1080,27 @@ var AnimationClipLoader = /*#__PURE__*/ function(Loader) {
1061
1080
  _this.request(item.url, _extends({}, item, {
1062
1081
  type: "arraybuffer"
1063
1082
  })).then(function(data) {
1064
- return decode(data, resourceManager.engine).then(resolve);
1083
+ return decode(data, resourceManager.engine).then(function(clip) {
1084
+ var curveBindingPromises = clip.curveBindings.map(function(curveBinding) {
1085
+ var curve = curveBinding.curve;
1086
+ var promises = curve.keys.map(function(key) {
1087
+ var value = key.value;
1088
+ if (typeof value === "object" && value.refId) {
1089
+ return new Promise(function(resolve) {
1090
+ resourceManager// @ts-ignore
1091
+ .getResourceByRef(value).then(function(asset) {
1092
+ key.value = asset;
1093
+ resolve(key);
1094
+ }).catch(reject);
1095
+ });
1096
+ }
1097
+ });
1098
+ return Promise.all(promises);
1099
+ });
1100
+ return Promise.all(curveBindingPromises).then(function() {
1101
+ resolve(clip);
1102
+ });
1103
+ });
1065
1104
  }).catch(reject);
1066
1105
  });
1067
1106
  };
@@ -1097,6 +1136,7 @@ var AnimatorControllerLoader = /*#__PURE__*/ function(Loader1) {
1097
1136
  var states = stateMachineData.states;
1098
1137
  var stateMachine = layer.stateMachine = new AnimatorStateMachine();
1099
1138
  states.forEach(function(stateData, stateIndex) {
1139
+ var _scriptsObject;
1100
1140
  var name = stateData.name, speed = stateData.speed, wrapMode = stateData.wrapMode, clipStartNormalizedTime = stateData.clipStartNormalizedTime, clipEndNormalizedTime = stateData.clipEndNormalizedTime, isDefaultState = stateData.isDefaultState, clipData = stateData.clip, scripts = stateData.scripts;
1101
1141
  var state = stateMachine.addState(name);
1102
1142
  isDefaultState && (stateMachine.defaultState = state);
@@ -1105,7 +1145,7 @@ var AnimatorControllerLoader = /*#__PURE__*/ function(Loader1) {
1105
1145
  state.clipStartTime = clipStartNormalizedTime;
1106
1146
  state.clipEndTime = clipEndNormalizedTime;
1107
1147
  var scriptsObject = JSON.parse(scripts);
1108
- scriptsObject == null ? void 0 : scriptsObject.forEach(function(script) {
1148
+ (_scriptsObject = scriptsObject) == null ? void 0 : _scriptsObject.forEach(function(script) {
1109
1149
  state.addStateMachineScript(Loader.getClass(script));
1110
1150
  });
1111
1151
  if (clipData) {
@@ -1159,10 +1199,10 @@ AnimatorControllerLoader = __decorate([
1159
1199
  function isBase64(url) {
1160
1200
  return /^data:(.+?);base64,/.test(url);
1161
1201
  }
1162
- var BufferLoader = /*#__PURE__*/ function(Loader) {
1163
- _inherits(BufferLoader, Loader);
1202
+ var BufferLoader = /*#__PURE__*/ function(Loader1) {
1203
+ _inherits(BufferLoader, Loader1);
1164
1204
  function BufferLoader() {
1165
- return Loader.apply(this, arguments);
1205
+ return Loader1.apply(this, arguments);
1166
1206
  }
1167
1207
  var _proto = BufferLoader.prototype;
1168
1208
  _proto.load = function load(item) {
@@ -1189,10 +1229,10 @@ BufferLoader = __decorate([
1189
1229
  ], false)
1190
1230
  ], BufferLoader);
1191
1231
 
1192
- var EnvLoader = /*#__PURE__*/ function(Loader) {
1193
- _inherits(EnvLoader, Loader);
1232
+ var EnvLoader = /*#__PURE__*/ function(Loader1) {
1233
+ _inherits(EnvLoader, Loader1);
1194
1234
  function EnvLoader() {
1195
- return Loader.apply(this, arguments);
1235
+ return Loader1.apply(this, arguments);
1196
1236
  }
1197
1237
  var _proto = EnvLoader.prototype;
1198
1238
  _proto.load = function load(item, resourceManager) {
@@ -1201,10 +1241,10 @@ var EnvLoader = /*#__PURE__*/ function(Loader) {
1201
1241
  _this.request(item.url, {
1202
1242
  type: "arraybuffer"
1203
1243
  }).then(function(arraybuffer) {
1204
- var _ref;
1244
+ var _this;
1205
1245
  var shArray = new Float32Array(arraybuffer, 0, 27);
1206
1246
  var shByteLength = 27 * 4;
1207
- var size = (_ref = new Uint16Array(arraybuffer, shByteLength, 1)) == null ? void 0 : _ref[0];
1247
+ var size = (_this = new Uint16Array(arraybuffer, shByteLength, 1)) == null ? void 0 : _this[0];
1208
1248
  var engine = resourceManager.engine;
1209
1249
  var texture = new TextureCube(engine, size);
1210
1250
  texture.filterMode = TextureFilterMode.Trilinear;
@@ -1271,10 +1311,10 @@ function _async_to_generator(fn) {
1271
1311
  };
1272
1312
  }
1273
1313
 
1274
- var FontLoader = /*#__PURE__*/ function(Loader) {
1275
- _inherits(FontLoader, Loader);
1314
+ var FontLoader = /*#__PURE__*/ function(Loader1) {
1315
+ _inherits(FontLoader, Loader1);
1276
1316
  function FontLoader() {
1277
- return Loader.apply(this, arguments);
1317
+ return Loader1.apply(this, arguments);
1278
1318
  }
1279
1319
  var _proto = FontLoader.prototype;
1280
1320
  _proto.load = function load(item, resourceManager) {
@@ -1331,11 +1371,11 @@ FontLoader = __decorate([
1331
1371
 
1332
1372
  /**
1333
1373
  * Product after glTF parser, usually, `defaultSceneRoot` is only needed to use.
1334
- */ var GLTFResource = /*#__PURE__*/ function(ReferResource) {
1335
- _inherits(GLTFResource, ReferResource);
1374
+ */ var GLTFResource = /*#__PURE__*/ function(ReferResource1) {
1375
+ _inherits(GLTFResource, ReferResource1);
1336
1376
  function GLTFResource(engine, url) {
1337
1377
  var _this;
1338
- _this = ReferResource.call(this, engine) || this;
1378
+ _this = ReferResource1.call(this, engine) || this;
1339
1379
  _this.url = url;
1340
1380
  return _this;
1341
1381
  }
@@ -2538,10 +2578,10 @@ var AbstractTranscoder = /*#__PURE__*/ function() {
2538
2578
  };
2539
2579
  }
2540
2580
 
2541
- /** @internal */ var BinomialLLCTranscoder = /*#__PURE__*/ function(AbstractTranscoder) {
2542
- _inherits(BinomialLLCTranscoder, AbstractTranscoder);
2581
+ /** @internal */ var BinomialLLCTranscoder = /*#__PURE__*/ function(AbstractTranscoder1) {
2582
+ _inherits(BinomialLLCTranscoder, AbstractTranscoder1);
2543
2583
  function BinomialLLCTranscoder(workerLimitCount) {
2544
- return AbstractTranscoder.call(this, workerLimitCount);
2584
+ return AbstractTranscoder1.call(this, workerLimitCount);
2545
2585
  }
2546
2586
  var _proto = BinomialLLCTranscoder.prototype;
2547
2587
  _proto._initTranscodeWorkerPool = function _initTranscodeWorkerPool() {
@@ -2718,11 +2758,11 @@ function TranscodeWorkerCode() {
2718
2758
  };
2719
2759
  }
2720
2760
 
2721
- /** @internal */ var KhronosTranscoder = /*#__PURE__*/ function(AbstractTranscoder) {
2722
- _inherits(KhronosTranscoder, AbstractTranscoder);
2761
+ /** @internal */ var KhronosTranscoder = /*#__PURE__*/ function(AbstractTranscoder1) {
2762
+ _inherits(KhronosTranscoder, AbstractTranscoder1);
2723
2763
  function KhronosTranscoder(workerLimitCount, type) {
2724
2764
  var _this;
2725
- _this = AbstractTranscoder.call(this, workerLimitCount) || this;
2765
+ _this = AbstractTranscoder1.call(this, workerLimitCount) || this;
2726
2766
  _this.type = type;
2727
2767
  return _this;
2728
2768
  }
@@ -2790,10 +2830,10 @@ function TranscodeWorkerCode() {
2790
2830
  })();
2791
2831
 
2792
2832
  var _KTX2Loader;
2793
- var KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader) {
2794
- _inherits(KTX2Loader1, Loader);
2833
+ var KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
2834
+ _inherits(KTX2Loader1, Loader1);
2795
2835
  function KTX2Loader1() {
2796
- return Loader.apply(this, arguments);
2836
+ return Loader1.apply(this, arguments);
2797
2837
  }
2798
2838
  var _proto = KTX2Loader1.prototype;
2799
2839
  _proto.initialize = function initialize(engine, configuration) {
@@ -2849,8 +2889,9 @@ var KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader) {
2849
2889
  this._isBinomialInit = false;
2850
2890
  };
2851
2891
  /** @internal */ KTX2Loader1._parseBuffer = function _parseBuffer(buffer, engine, params) {
2892
+ var _params;
2852
2893
  var ktx2Container = new KTX2Container(buffer);
2853
- var formatPriorities = params == null ? void 0 : params.priorityFormats;
2894
+ var formatPriorities = (_params = params) == null ? void 0 : _params.priorityFormats;
2854
2895
  var targetFormat = KTX2Loader._decideTargetFormat(engine, ktx2Container, formatPriorities);
2855
2896
  var transcodeResultPromise;
2856
2897
  if (KTX2Loader._isBinomialInit || !KhronosTranscoder.transcoderMap[targetFormat] || !ktx2Container.isUASTC) {
@@ -2988,11 +3029,11 @@ KTX2Loader = __decorate([
2988
3029
 
2989
3030
  /**
2990
3031
  * @internal
2991
- */ var GLTFContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
2992
- _inherits(GLTFContentRestorer, ContentRestorer);
3032
+ */ var GLTFContentRestorer = /*#__PURE__*/ function(ContentRestorer1) {
3033
+ _inherits(GLTFContentRestorer, ContentRestorer1);
2993
3034
  function GLTFContentRestorer() {
2994
3035
  var _this;
2995
- _this = ContentRestorer.apply(this, arguments) || this;
3036
+ _this = ContentRestorer1.apply(this, arguments) || this;
2996
3037
  _this.bufferRequests = [];
2997
3038
  _this.glbBufferSlices = [];
2998
3039
  _this.bufferTextures = [];
@@ -3160,24 +3201,6 @@ KTX2Loader = __decorate([
3160
3201
  this.count = count;
3161
3202
  };
3162
3203
 
3163
- function _array_without_holes(arr) {
3164
- if (Array.isArray(arr)) return _array_like_to_array(arr);
3165
- }
3166
-
3167
- function _iterable_to_array(iter) {
3168
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
3169
- return Array.from(iter);
3170
- }
3171
- }
3172
-
3173
- function _non_iterable_spread() {
3174
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3175
- }
3176
-
3177
- function _to_consumable_array(arr) {
3178
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
3179
- }
3180
-
3181
3204
  /**
3182
3205
  * Base class of glTF extension parser.
3183
3206
  */ var GLTFExtensionParser = /*#__PURE__*/ function() {
@@ -3244,12 +3267,7 @@ var GLTFExtensionMode;
3244
3267
  var _GLTFParser;
3245
3268
  var extensionName = extensionArray[i];
3246
3269
  var extensionSchema = extensions[extensionName];
3247
- resource = (_GLTFParser = GLTFParser)._createAndParse.apply(_GLTFParser, [
3248
- extensionName,
3249
- context,
3250
- extensionSchema,
3251
- ownerSchema
3252
- ].concat(_to_consumable_array(extra)));
3270
+ resource = (_GLTFParser = GLTFParser)._createAndParse.apply(_GLTFParser, [].concat(extensionName, context, extensionSchema, ownerSchema, extra));
3253
3271
  if (resource) {
3254
3272
  return resource;
3255
3273
  }
@@ -3269,13 +3287,7 @@ var GLTFExtensionMode;
3269
3287
  for(var extensionName in extensions){
3270
3288
  var _GLTFParser;
3271
3289
  var extensionSchema = extensions[extensionName];
3272
- (_GLTFParser = GLTFParser)._additiveParse.apply(_GLTFParser, [
3273
- extensionName,
3274
- context,
3275
- parseResource,
3276
- extensionSchema,
3277
- ownerSchema
3278
- ].concat(_to_consumable_array(extra)));
3290
+ (_GLTFParser = GLTFParser)._additiveParse.apply(_GLTFParser, [].concat(extensionName, context, parseResource, extensionSchema, ownerSchema, extra));
3279
3291
  }
3280
3292
  };
3281
3293
  /**
@@ -3292,8 +3304,9 @@ var GLTFExtensionMode;
3292
3304
  * @param mode - GLTF extension mode
3293
3305
  * @returns GLTF extension parser
3294
3306
  */ GLTFParser.getExtensionParser = function getExtensionParser(extensionName, mode) {
3307
+ var _parsers;
3295
3308
  var parsers = GLTFParser._extensionParsers[extensionName];
3296
- var length = parsers == null ? void 0 : parsers.length;
3309
+ var length = (_parsers = parsers) == null ? void 0 : _parsers.length;
3297
3310
  if (length) {
3298
3311
  // only use the last parser.
3299
3312
  for(var i = length - 1; i >= 0; --i){
@@ -3319,11 +3332,7 @@ var GLTFExtensionMode;
3319
3332
  var parser = GLTFParser.getExtensionParser(extensionName, GLTFExtensionMode.CreateAndParse);
3320
3333
  if (parser) {
3321
3334
  var _parser;
3322
- return (_parser = parser).createAndParse.apply(_parser, [
3323
- context,
3324
- extensionSchema,
3325
- ownerSchema
3326
- ].concat(_to_consumable_array(extra)));
3335
+ return (_parser = parser).createAndParse.apply(_parser, [].concat(context, extensionSchema, ownerSchema, extra));
3327
3336
  }
3328
3337
  };
3329
3338
  GLTFParser._additiveParse = function _additiveParse(extensionName, context, parseResource, extensionSchema, ownerSchema) {
@@ -3333,12 +3342,7 @@ var GLTFExtensionMode;
3333
3342
  var parser = GLTFParser.getExtensionParser(extensionName, GLTFExtensionMode.AdditiveParse);
3334
3343
  if (parser) {
3335
3344
  var _parser;
3336
- (_parser = parser).additiveParse.apply(_parser, [
3337
- context,
3338
- parseResource,
3339
- extensionSchema,
3340
- ownerSchema
3341
- ].concat(_to_consumable_array(extra)));
3345
+ (_parser = parser).additiveParse.apply(_parser, [].concat(context, parseResource, extensionSchema, ownerSchema, extra));
3342
3346
  }
3343
3347
  };
3344
3348
  return GLTFParser;
@@ -3357,10 +3361,10 @@ var GLTFExtensionMode;
3357
3361
  };
3358
3362
  }
3359
3363
 
3360
- var GLTFSchemaParser = /*#__PURE__*/ function(GLTFParser) {
3361
- _inherits(GLTFSchemaParser, GLTFParser);
3364
+ var GLTFSchemaParser = /*#__PURE__*/ function(GLTFParser1) {
3365
+ _inherits(GLTFSchemaParser, GLTFParser1);
3362
3366
  function GLTFSchemaParser() {
3363
- return GLTFParser.apply(this, arguments);
3367
+ return GLTFParser1.apply(this, arguments);
3364
3368
  }
3365
3369
  var _proto = GLTFSchemaParser.prototype;
3366
3370
  _proto.parse = function parse(context) {
@@ -3576,10 +3580,10 @@ GLTFAnimationParser = __decorate([
3576
3580
  registerGLTFParser(GLTFParserType.Animation)
3577
3581
  ], GLTFAnimationParser);
3578
3582
 
3579
- var GLTFBufferParser = /*#__PURE__*/ function(GLTFParser) {
3580
- _inherits(GLTFBufferParser, GLTFParser);
3583
+ var GLTFBufferParser = /*#__PURE__*/ function(GLTFParser1) {
3584
+ _inherits(GLTFBufferParser, GLTFParser1);
3581
3585
  function GLTFBufferParser() {
3582
- return GLTFParser.apply(this, arguments);
3586
+ return GLTFParser1.apply(this, arguments);
3583
3587
  }
3584
3588
  var _proto = GLTFBufferParser.prototype;
3585
3589
  _proto.parse = function parse(context, index) {
@@ -4201,10 +4205,10 @@ GLTFSceneParser = __decorate([
4201
4205
  registerGLTFParser(GLTFParserType.Scene)
4202
4206
  ], GLTFSceneParser);
4203
4207
 
4204
- var GLTFSkinParser = /*#__PURE__*/ function(GLTFParser) {
4205
- _inherits(GLTFSkinParser, GLTFParser);
4208
+ var GLTFSkinParser = /*#__PURE__*/ function(GLTFParser1) {
4209
+ _inherits(GLTFSkinParser, GLTFParser1);
4206
4210
  function GLTFSkinParser() {
4207
- return GLTFParser.apply(this, arguments);
4211
+ return GLTFParser1.apply(this, arguments);
4208
4212
  }
4209
4213
  var _proto = GLTFSkinParser.prototype;
4210
4214
  _proto.parse = function parse(context, index) {
@@ -4300,6 +4304,7 @@ var GLTFTextureParser = (_GLTFTextureParser = /*#__PURE__*/ function(GLTFParser1
4300
4304
  var useSampler = sampler !== undefined;
4301
4305
  var samplerInfo = sampler !== undefined && GLTFUtils.getSamplerInfo(glTF.samplers[sampler]);
4302
4306
  if (uri) {
4307
+ var _samplerInfo;
4303
4308
  // TODO: deleted in 2.0
4304
4309
  var extIndex = uri.lastIndexOf(".");
4305
4310
  var ext = uri.substring(extIndex + 1);
@@ -4308,7 +4313,7 @@ var GLTFTextureParser = (_GLTFTextureParser = /*#__PURE__*/ function(GLTFParser1
4308
4313
  url: Utils.resolveAbsoluteUrl(url, uri),
4309
4314
  type: type,
4310
4315
  params: {
4311
- mipmap: samplerInfo == null ? void 0 : samplerInfo.mipmap
4316
+ mipmap: (_samplerInfo = samplerInfo) == null ? void 0 : _samplerInfo.mipmap
4312
4317
  }
4313
4318
  }).then(function(texture) {
4314
4319
  var _texture;
@@ -4322,7 +4327,8 @@ var GLTFTextureParser = (_GLTFTextureParser = /*#__PURE__*/ function(GLTFParser1
4322
4327
  var buffer = buffers[bufferView.buffer];
4323
4328
  var imageBuffer = new Uint8Array(buffer, bufferView.byteOffset, bufferView.byteLength);
4324
4329
  return GLTFUtils.loadImageBuffer(imageBuffer, mimeType).then(function(image) {
4325
- var texture = new Texture2D(engine, image.width, image.height, undefined, samplerInfo == null ? void 0 : samplerInfo.mipmap);
4330
+ var _samplerInfo;
4331
+ var texture = new Texture2D(engine, image.width, image.height, undefined, (_samplerInfo = samplerInfo) == null ? void 0 : _samplerInfo.mipmap);
4326
4332
  texture.setImageSource(image);
4327
4333
  texture.generateMipmaps();
4328
4334
  texture.name = textureName || imageName || "texture_" + index;
@@ -4386,17 +4392,18 @@ GLTFValidator = __decorate([
4386
4392
  registerGLTFParser(GLTFParserType.Validator)
4387
4393
  ], GLTFValidator);
4388
4394
 
4389
- var GLTFLoader = /*#__PURE__*/ function(Loader) {
4390
- _inherits(GLTFLoader, Loader);
4395
+ var GLTFLoader = /*#__PURE__*/ function(Loader1) {
4396
+ _inherits(GLTFLoader, Loader1);
4391
4397
  function GLTFLoader() {
4392
- return Loader.apply(this, arguments);
4398
+ return Loader1.apply(this, arguments);
4393
4399
  }
4394
4400
  var _proto = GLTFLoader.prototype;
4395
4401
  _proto.load = function load(item, resourceManager) {
4402
+ var _params;
4396
4403
  var url = item.url;
4397
4404
  var params = item.params;
4398
4405
  var glTFResource = new GLTFResource(resourceManager.engine, url);
4399
- var context = new GLTFParserContext(glTFResource, resourceManager, !!(params == null ? void 0 : params.keepMeshData));
4406
+ var context = new GLTFParserContext(glTFResource, resourceManager, !!((_params = params) == null ? void 0 : _params.keepMeshData));
4400
4407
  return context.parse();
4401
4408
  };
4402
4409
  return GLTFLoader;
@@ -4410,10 +4417,10 @@ GLTFLoader = __decorate([
4410
4417
 
4411
4418
  var _HDRLoader;
4412
4419
  var PI = Math.PI;
4413
- var HDRLoader = (_HDRLoader = /*#__PURE__*/ function(Loader) {
4414
- _inherits(HDRLoader1, Loader);
4420
+ var HDRLoader = (_HDRLoader = /*#__PURE__*/ function(Loader1) {
4421
+ _inherits(HDRLoader1, Loader1);
4415
4422
  function HDRLoader1() {
4416
- return Loader.apply(this, arguments);
4423
+ return Loader1.apply(this, arguments);
4417
4424
  }
4418
4425
  var _proto = HDRLoader1.prototype;
4419
4426
  _proto.load = function load(item, resourceManager) {
@@ -4724,10 +4731,10 @@ HDRLoader = __decorate([
4724
4731
  ])
4725
4732
  ], HDRLoader);
4726
4733
 
4727
- var JSONLoader = /*#__PURE__*/ function(Loader) {
4728
- _inherits(JSONLoader, Loader);
4734
+ var JSONLoader = /*#__PURE__*/ function(Loader1) {
4735
+ _inherits(JSONLoader, Loader1);
4729
4736
  function JSONLoader() {
4730
- return Loader.apply(this, arguments);
4737
+ return Loader1.apply(this, arguments);
4731
4738
  }
4732
4739
  var _proto = JSONLoader.prototype;
4733
4740
  _proto.load = function load(item) {
@@ -4928,10 +4935,10 @@ function parseCubeKTX(dataArray) {
4928
4935
  };
4929
4936
  }
4930
4937
 
4931
- var KTXCubeLoader = /*#__PURE__*/ function(Loader) {
4932
- _inherits(KTXCubeLoader, Loader);
4938
+ var KTXCubeLoader = /*#__PURE__*/ function(Loader1) {
4939
+ _inherits(KTXCubeLoader, Loader1);
4933
4940
  function KTXCubeLoader() {
4934
- return Loader.apply(this, arguments);
4941
+ return Loader1.apply(this, arguments);
4935
4942
  }
4936
4943
  var _proto = KTXCubeLoader.prototype;
4937
4944
  _proto.load = function load(item, resourceManager) {
@@ -4965,10 +4972,10 @@ KTXCubeLoader = __decorate([
4965
4972
  resourceLoader(AssetType.KTXCube, [])
4966
4973
  ], KTXCubeLoader);
4967
4974
 
4968
- var KTXLoader = /*#__PURE__*/ function(Loader) {
4969
- _inherits(KTXLoader, Loader);
4975
+ var KTXLoader = /*#__PURE__*/ function(Loader1) {
4976
+ _inherits(KTXLoader, Loader1);
4970
4977
  function KTXLoader() {
4971
- return Loader.apply(this, arguments);
4978
+ return Loader1.apply(this, arguments);
4972
4979
  }
4973
4980
  var _proto = KTXLoader.prototype;
4974
4981
  _proto.load = function load(item, resourceManager) {
@@ -5008,10 +5015,10 @@ function parseProperty(object, key, value) {
5008
5015
  object[key] = value;
5009
5016
  }
5010
5017
  }
5011
- var MaterialLoader = /*#__PURE__*/ function(Loader) {
5012
- _inherits(MaterialLoader, Loader);
5018
+ var MaterialLoader = /*#__PURE__*/ function(Loader1) {
5019
+ _inherits(MaterialLoader, Loader1);
5013
5020
  function MaterialLoader() {
5014
- return Loader.apply(this, arguments);
5021
+ return Loader1.apply(this, arguments);
5015
5022
  }
5016
5023
  var _proto = MaterialLoader.prototype;
5017
5024
  _proto.load = function load(item, resourceManager) {
@@ -5076,10 +5083,10 @@ MaterialLoader = __decorate([
5076
5083
  ])
5077
5084
  ], MaterialLoader);
5078
5085
 
5079
- var MeshLoader = /*#__PURE__*/ function(Loader) {
5080
- _inherits(MeshLoader, Loader);
5086
+ var MeshLoader = /*#__PURE__*/ function(Loader1) {
5087
+ _inherits(MeshLoader, Loader1);
5081
5088
  function MeshLoader() {
5082
- return Loader.apply(this, arguments);
5089
+ return Loader1.apply(this, arguments);
5083
5090
  }
5084
5091
  var _proto = MeshLoader.prototype;
5085
5092
  _proto.load = function load(item, resourceManager) {
@@ -5102,10 +5109,10 @@ MeshLoader = __decorate([
5102
5109
  ])
5103
5110
  ], MeshLoader);
5104
5111
 
5105
- var SourceFontLoader = /*#__PURE__*/ function(Loader) {
5106
- _inherits(SourceFontLoader, Loader);
5112
+ var SourceFontLoader = /*#__PURE__*/ function(Loader1) {
5113
+ _inherits(SourceFontLoader, Loader1);
5107
5114
  function SourceFontLoader() {
5108
- return Loader.apply(this, arguments);
5115
+ return Loader1.apply(this, arguments);
5109
5116
  }
5110
5117
  var _proto = SourceFontLoader.prototype;
5111
5118
  _proto.load = function load(item, resourceManager) {
@@ -5151,11 +5158,11 @@ SourceFontLoader = __decorate([
5151
5158
  ], false)
5152
5159
  ], SourceFontLoader);
5153
5160
 
5154
- var SpriteAtlasLoader = /*#__PURE__*/ function(Loader) {
5155
- _inherits(SpriteAtlasLoader, Loader);
5161
+ var SpriteAtlasLoader = /*#__PURE__*/ function(Loader1) {
5162
+ _inherits(SpriteAtlasLoader, Loader1);
5156
5163
  function SpriteAtlasLoader() {
5157
5164
  var _this;
5158
- _this = Loader.apply(this, arguments) || this;
5165
+ _this = Loader1.apply(this, arguments) || this;
5159
5166
  _this._tempRect = new Rect();
5160
5167
  _this._tempVec2 = new Vector2();
5161
5168
  _this._tempVec4 = new Vector4();
@@ -5243,10 +5250,10 @@ SpriteAtlasLoader = __decorate([
5243
5250
  ], false)
5244
5251
  ], SpriteAtlasLoader);
5245
5252
 
5246
- var SpriteLoader = /*#__PURE__*/ function(Loader) {
5247
- _inherits(SpriteLoader, Loader);
5253
+ var SpriteLoader = /*#__PURE__*/ function(Loader1) {
5254
+ _inherits(SpriteLoader, Loader1);
5248
5255
  function SpriteLoader() {
5249
- return Loader.apply(this, arguments);
5256
+ return Loader1.apply(this, arguments);
5250
5257
  }
5251
5258
  var _proto = SpriteLoader.prototype;
5252
5259
  _proto.load = function load(item, resourceManager) {
@@ -5281,11 +5288,11 @@ SpriteLoader = __decorate([
5281
5288
 
5282
5289
  /**
5283
5290
  * @internal
5284
- */ var Texture2DContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
5285
- _inherits(Texture2DContentRestorer, ContentRestorer);
5291
+ */ var Texture2DContentRestorer = /*#__PURE__*/ function(ContentRestorer1) {
5292
+ _inherits(Texture2DContentRestorer, ContentRestorer1);
5286
5293
  function Texture2DContentRestorer(resource, url, requestConfig) {
5287
5294
  var _this;
5288
- _this = ContentRestorer.call(this, resource) || this;
5295
+ _this = ContentRestorer1.call(this, resource) || this;
5289
5296
  _this.url = url;
5290
5297
  _this.requestConfig = requestConfig;
5291
5298
  return _this;
@@ -5303,10 +5310,10 @@ SpriteLoader = __decorate([
5303
5310
  return Texture2DContentRestorer;
5304
5311
  }(ContentRestorer);
5305
5312
 
5306
- var Texture2DLoader = /*#__PURE__*/ function(Loader) {
5307
- _inherits(Texture2DLoader, Loader);
5313
+ var Texture2DLoader = /*#__PURE__*/ function(Loader1) {
5314
+ _inherits(Texture2DLoader, Loader1);
5308
5315
  function Texture2DLoader() {
5309
- return Loader.apply(this, arguments);
5316
+ return Loader1.apply(this, arguments);
5310
5317
  }
5311
5318
  var _proto = Texture2DLoader.prototype;
5312
5319
  _proto.load = function load(item, resourceManager) {
@@ -5317,8 +5324,9 @@ var Texture2DLoader = /*#__PURE__*/ function(Loader) {
5317
5324
  type: "image"
5318
5325
  });
5319
5326
  _this.request(url, requestConfig).then(function(image) {
5327
+ var _params, _params1;
5320
5328
  var params = item.params;
5321
- var texture = new Texture2D(resourceManager.engine, image.width, image.height, params == null ? void 0 : params.format, params == null ? void 0 : params.mipmap);
5329
+ var texture = new Texture2D(resourceManager.engine, image.width, image.height, (_params = params) == null ? void 0 : _params.format, (_params1 = params) == null ? void 0 : _params1.mipmap);
5322
5330
  texture.setImageSource(image);
5323
5331
  texture.generateMipmaps();
5324
5332
  if (url.indexOf("data:") !== 0) {
@@ -5345,11 +5353,11 @@ Texture2DLoader = __decorate([
5345
5353
 
5346
5354
  /**
5347
5355
  * @internal
5348
- */ var TextureCubeContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
5349
- _inherits(TextureCubeContentRestorer, ContentRestorer);
5356
+ */ var TextureCubeContentRestorer = /*#__PURE__*/ function(ContentRestorer1) {
5357
+ _inherits(TextureCubeContentRestorer, ContentRestorer1);
5350
5358
  function TextureCubeContentRestorer(resource, urls, requestConfig) {
5351
5359
  var _this;
5352
- _this = ContentRestorer.call(this, resource) || this;
5360
+ _this = ContentRestorer1.call(this, resource) || this;
5353
5361
  _this.urls = urls;
5354
5362
  _this.requestConfig = requestConfig;
5355
5363
  return _this;
@@ -5375,10 +5383,10 @@ Texture2DLoader = __decorate([
5375
5383
  return TextureCubeContentRestorer;
5376
5384
  }(ContentRestorer);
5377
5385
 
5378
- var TextureCubeLoader = /*#__PURE__*/ function(Loader) {
5379
- _inherits(TextureCubeLoader, Loader);
5386
+ var TextureCubeLoader = /*#__PURE__*/ function(Loader1) {
5387
+ _inherits(TextureCubeLoader, Loader1);
5380
5388
  function TextureCubeLoader() {
5381
- return Loader.apply(this, arguments);
5389
+ return Loader1.apply(this, arguments);
5382
5390
  }
5383
5391
  var _proto = TextureCubeLoader.prototype;
5384
5392
  _proto.load = function load(item, resourceManager) {
@@ -5416,10 +5424,10 @@ TextureCubeLoader = __decorate([
5416
5424
  ])
5417
5425
  ], TextureCubeLoader);
5418
5426
 
5419
- var SceneLoader = /*#__PURE__*/ function(Loader) {
5420
- _inherits(SceneLoader, Loader);
5427
+ var SceneLoader = /*#__PURE__*/ function(Loader1) {
5428
+ _inherits(SceneLoader, Loader1);
5421
5429
  function SceneLoader() {
5422
- return Loader.apply(this, arguments);
5430
+ return Loader1.apply(this, arguments);
5423
5431
  }
5424
5432
  var _proto = SceneLoader.prototype;
5425
5433
  _proto.load = function load(item, resourceManager) {
@@ -5513,7 +5521,7 @@ var SceneLoader = /*#__PURE__*/ function(Loader) {
5513
5521
  }(Loader);
5514
5522
  SceneLoader = __decorate([
5515
5523
  resourceLoader(AssetType.Scene, [
5516
- "prefab"
5524
+ "scene"
5517
5525
  ], true)
5518
5526
  ], SceneLoader);
5519
5527
  ReflectionParser.registerCustomParseComponent("TextRenderer", /*#__PURE__*/ _async_to_generator(function(instance, item, engine) {
@@ -5532,10 +5540,10 @@ ReflectionParser.registerCustomParseComponent("TextRenderer", /*#__PURE__*/ _asy
5532
5540
  }));
5533
5541
 
5534
5542
  var _KHR_draco_mesh_compression;
5535
- var KHR_draco_mesh_compression = (_KHR_draco_mesh_compression = /*#__PURE__*/ function(GLTFExtensionParser) {
5536
- _inherits(KHR_draco_mesh_compression1, GLTFExtensionParser);
5543
+ var KHR_draco_mesh_compression = (_KHR_draco_mesh_compression = /*#__PURE__*/ function(GLTFExtensionParser1) {
5544
+ _inherits(KHR_draco_mesh_compression1, GLTFExtensionParser1);
5537
5545
  function KHR_draco_mesh_compression1() {
5538
- return GLTFExtensionParser.apply(this, arguments);
5546
+ return GLTFExtensionParser1.apply(this, arguments);
5539
5547
  }
5540
5548
  var _proto = KHR_draco_mesh_compression1.prototype;
5541
5549
  _proto.createAndParse = function createAndParse(context, schema, glTFPrimitive, glTFMesh) {
@@ -5695,10 +5703,10 @@ KHR_draco_mesh_compression = __decorate([
5695
5703
  registerGLTFExtension("KHR_draco_mesh_compression", GLTFExtensionMode.CreateAndParse)
5696
5704
  ], KHR_draco_mesh_compression);
5697
5705
 
5698
- var KHR_lights_punctual = /*#__PURE__*/ function(GLTFExtensionParser) {
5699
- _inherits(KHR_lights_punctual, GLTFExtensionParser);
5706
+ var KHR_lights_punctual = /*#__PURE__*/ function(GLTFExtensionParser1) {
5707
+ _inherits(KHR_lights_punctual, GLTFExtensionParser1);
5700
5708
  function KHR_lights_punctual() {
5701
- return GLTFExtensionParser.apply(this, arguments);
5709
+ return GLTFExtensionParser1.apply(this, arguments);
5702
5710
  }
5703
5711
  var _proto = KHR_lights_punctual.prototype;
5704
5712
  _proto.additiveParse = function additiveParse(context, entity, extensionSchema) {
@@ -5736,10 +5744,10 @@ KHR_lights_punctual = __decorate([
5736
5744
  registerGLTFExtension("KHR_lights_punctual", GLTFExtensionMode.AdditiveParse)
5737
5745
  ], KHR_lights_punctual);
5738
5746
 
5739
- var KHR_materials_clearcoat = /*#__PURE__*/ function(GLTFExtensionParser) {
5740
- _inherits(KHR_materials_clearcoat, GLTFExtensionParser);
5747
+ var KHR_materials_clearcoat = /*#__PURE__*/ function(GLTFExtensionParser1) {
5748
+ _inherits(KHR_materials_clearcoat, GLTFExtensionParser1);
5741
5749
  function KHR_materials_clearcoat() {
5742
- return GLTFExtensionParser.apply(this, arguments);
5750
+ return GLTFExtensionParser1.apply(this, arguments);
5743
5751
  }
5744
5752
  var _proto = KHR_materials_clearcoat.prototype;
5745
5753
  _proto.additiveParse = function additiveParse(context, material, schema) {
@@ -5771,10 +5779,10 @@ KHR_materials_clearcoat = __decorate([
5771
5779
  registerGLTFExtension("KHR_materials_clearcoat", GLTFExtensionMode.AdditiveParse)
5772
5780
  ], KHR_materials_clearcoat);
5773
5781
 
5774
- var KHR_materials_ior = /*#__PURE__*/ function(GLTFExtensionParser) {
5775
- _inherits(KHR_materials_ior, GLTFExtensionParser);
5782
+ var KHR_materials_ior = /*#__PURE__*/ function(GLTFExtensionParser1) {
5783
+ _inherits(KHR_materials_ior, GLTFExtensionParser1);
5776
5784
  function KHR_materials_ior() {
5777
- return GLTFExtensionParser.apply(this, arguments);
5785
+ return GLTFExtensionParser1.apply(this, arguments);
5778
5786
  }
5779
5787
  var _proto = KHR_materials_ior.prototype;
5780
5788
  _proto.additiveParse = function additiveParse(context, material, schema) {
@@ -5787,10 +5795,10 @@ KHR_materials_ior = __decorate([
5787
5795
  registerGLTFExtension("KHR_materials_ior", GLTFExtensionMode.AdditiveParse)
5788
5796
  ], KHR_materials_ior);
5789
5797
 
5790
- var KHR_materials_pbrSpecularGlossiness = /*#__PURE__*/ function(GLTFExtensionParser) {
5791
- _inherits(KHR_materials_pbrSpecularGlossiness, GLTFExtensionParser);
5798
+ var KHR_materials_pbrSpecularGlossiness = /*#__PURE__*/ function(GLTFExtensionParser1) {
5799
+ _inherits(KHR_materials_pbrSpecularGlossiness, GLTFExtensionParser1);
5792
5800
  function KHR_materials_pbrSpecularGlossiness() {
5793
- return GLTFExtensionParser.apply(this, arguments);
5801
+ return GLTFExtensionParser1.apply(this, arguments);
5794
5802
  }
5795
5803
  var _proto = KHR_materials_pbrSpecularGlossiness.prototype;
5796
5804
  _proto.createAndParse = function createAndParse(context, schema, ownerSchema) {
@@ -5828,10 +5836,10 @@ KHR_materials_pbrSpecularGlossiness = __decorate([
5828
5836
  registerGLTFExtension("KHR_materials_pbrSpecularGlossiness", GLTFExtensionMode.CreateAndParse)
5829
5837
  ], KHR_materials_pbrSpecularGlossiness);
5830
5838
 
5831
- var KHR_materials_unlit = /*#__PURE__*/ function(GLTFExtensionParser) {
5832
- _inherits(KHR_materials_unlit, GLTFExtensionParser);
5839
+ var KHR_materials_unlit = /*#__PURE__*/ function(GLTFExtensionParser1) {
5840
+ _inherits(KHR_materials_unlit, GLTFExtensionParser1);
5833
5841
  function KHR_materials_unlit() {
5834
- return GLTFExtensionParser.apply(this, arguments);
5842
+ return GLTFExtensionParser1.apply(this, arguments);
5835
5843
  }
5836
5844
  var _proto = KHR_materials_unlit.prototype;
5837
5845
  _proto.createAndParse = function createAndParse(context, _, ownerSchema) {
@@ -5847,10 +5855,10 @@ KHR_materials_unlit = __decorate([
5847
5855
  registerGLTFExtension("KHR_materials_unlit", GLTFExtensionMode.CreateAndParse)
5848
5856
  ], KHR_materials_unlit);
5849
5857
 
5850
- var KHR_materials_variants = /*#__PURE__*/ function(GLTFExtensionParser) {
5851
- _inherits(KHR_materials_variants, GLTFExtensionParser);
5858
+ var KHR_materials_variants = /*#__PURE__*/ function(GLTFExtensionParser1) {
5859
+ _inherits(KHR_materials_variants, GLTFExtensionParser1);
5852
5860
  function KHR_materials_variants() {
5853
- return GLTFExtensionParser.apply(this, arguments);
5861
+ return GLTFExtensionParser1.apply(this, arguments);
5854
5862
  }
5855
5863
  var _proto = KHR_materials_variants.prototype;
5856
5864
  _proto.additiveParse = function additiveParse(context, renderer, schema) {
@@ -5880,10 +5888,10 @@ KHR_materials_variants = __decorate([
5880
5888
  registerGLTFExtension("KHR_materials_variants", GLTFExtensionMode.AdditiveParse)
5881
5889
  ], KHR_materials_variants);
5882
5890
 
5883
- var KHR_mesh_quantization = /*#__PURE__*/ function(GLTFExtensionParser) {
5884
- _inherits(KHR_mesh_quantization, GLTFExtensionParser);
5891
+ var KHR_mesh_quantization = /*#__PURE__*/ function(GLTFExtensionParser1) {
5892
+ _inherits(KHR_mesh_quantization, GLTFExtensionParser1);
5885
5893
  function KHR_mesh_quantization() {
5886
- return GLTFExtensionParser.apply(this, arguments);
5894
+ return GLTFExtensionParser1.apply(this, arguments);
5887
5895
  }
5888
5896
  return KHR_mesh_quantization;
5889
5897
  }(GLTFExtensionParser);
@@ -5891,10 +5899,10 @@ KHR_mesh_quantization = __decorate([
5891
5899
  registerGLTFExtension("KHR_mesh_quantization", GLTFExtensionMode.AdditiveParse)
5892
5900
  ], KHR_mesh_quantization);
5893
5901
 
5894
- var KHR_texture_basisu = /*#__PURE__*/ function(GLTFExtensionParser) {
5895
- _inherits(KHR_texture_basisu, GLTFExtensionParser);
5902
+ var KHR_texture_basisu = /*#__PURE__*/ function(GLTFExtensionParser1) {
5903
+ _inherits(KHR_texture_basisu, GLTFExtensionParser1);
5896
5904
  function KHR_texture_basisu() {
5897
- return GLTFExtensionParser.apply(this, arguments);
5905
+ return GLTFExtensionParser1.apply(this, arguments);
5898
5906
  }
5899
5907
  var _proto = KHR_texture_basisu.prototype;
5900
5908
  _proto.createAndParse = function createAndParse(context, schema, textureInfo) {
@@ -5954,10 +5962,10 @@ KHR_texture_basisu = __decorate([
5954
5962
  registerGLTFExtension("KHR_texture_basisu", GLTFExtensionMode.CreateAndParse)
5955
5963
  ], KHR_texture_basisu);
5956
5964
 
5957
- var KHR_texture_transform = /*#__PURE__*/ function(GLTFExtensionParser) {
5958
- _inherits(KHR_texture_transform, GLTFExtensionParser);
5965
+ var KHR_texture_transform = /*#__PURE__*/ function(GLTFExtensionParser1) {
5966
+ _inherits(KHR_texture_transform, GLTFExtensionParser1);
5959
5967
  function KHR_texture_transform() {
5960
- return GLTFExtensionParser.apply(this, arguments);
5968
+ return GLTFExtensionParser1.apply(this, arguments);
5961
5969
  }
5962
5970
  var _proto = KHR_texture_transform.prototype;
5963
5971
  _proto.additiveParse = function additiveParse(context, material, schema) {
@@ -5983,10 +5991,10 @@ KHR_texture_transform = __decorate([
5983
5991
  registerGLTFExtension("KHR_texture_transform", GLTFExtensionMode.AdditiveParse)
5984
5992
  ], KHR_texture_transform);
5985
5993
 
5986
- var GALACEAN_materials_remap = /*#__PURE__*/ function(GLTFExtensionParser) {
5987
- _inherits(GALACEAN_materials_remap, GLTFExtensionParser);
5994
+ var GALACEAN_materials_remap = /*#__PURE__*/ function(GLTFExtensionParser1) {
5995
+ _inherits(GALACEAN_materials_remap, GLTFExtensionParser1);
5988
5996
  function GALACEAN_materials_remap() {
5989
- return GLTFExtensionParser.apply(this, arguments);
5997
+ return GLTFExtensionParser1.apply(this, arguments);
5990
5998
  }
5991
5999
  var _proto = GALACEAN_materials_remap.prototype;
5992
6000
  _proto.createAndParse = function createAndParse(context, schema) {
@@ -6000,10 +6008,10 @@ GALACEAN_materials_remap = __decorate([
6000
6008
  registerGLTFExtension("GALACEAN_materials_remap", GLTFExtensionMode.CreateAndParse)
6001
6009
  ], GALACEAN_materials_remap);
6002
6010
 
6003
- var GALACEAN_animation_event = /*#__PURE__*/ function(GLTFExtensionParser) {
6004
- _inherits(GALACEAN_animation_event, GLTFExtensionParser);
6011
+ var GALACEAN_animation_event = /*#__PURE__*/ function(GLTFExtensionParser1) {
6012
+ _inherits(GALACEAN_animation_event, GLTFExtensionParser1);
6005
6013
  function GALACEAN_animation_event() {
6006
- return GLTFExtensionParser.apply(this, arguments);
6014
+ return GLTFExtensionParser1.apply(this, arguments);
6007
6015
  }
6008
6016
  var _proto = GALACEAN_animation_event.prototype;
6009
6017
  _proto.additiveParse = function additiveParse(context, animationClip, schema) {