@galacean/engine-loader 1.5.9 → 1.5.11

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
@@ -961,53 +961,6 @@ exports.Texture2DDecoder = __decorate([
961
961
  decoder("Texture2D")
962
962
  ], exports.Texture2DDecoder);
963
963
 
964
- exports.EditorTextureLoader = /*#__PURE__*/ function(Loader) {
965
- _inherits(EditorTextureLoader, Loader);
966
- function EditorTextureLoader() {
967
- return Loader.apply(this, arguments) || this;
968
- }
969
- var _proto = EditorTextureLoader.prototype;
970
- _proto.load = function load(item, resourceManager) {
971
- var requestConfig = _extends({}, item, {
972
- type: "arraybuffer"
973
- });
974
- var url = item.url;
975
- return new engineCore.AssetPromise(function(resolve, reject) {
976
- resourceManager// @ts-ignore
977
- ._request(url, requestConfig).then(function(data) {
978
- decode(data, resourceManager.engine).then(function(texture) {
979
- resourceManager.addContentRestorer(new EditorTexture2DContentRestorer(texture, url, requestConfig));
980
- resolve(texture);
981
- });
982
- }).catch(reject);
983
- });
984
- };
985
- return EditorTextureLoader;
986
- }(engineCore.Loader);
987
- exports.EditorTextureLoader = __decorate([
988
- engineCore.resourceLoader("EditorTexture2D", [
989
- "prefab"
990
- ], true)
991
- ], exports.EditorTextureLoader);
992
- var EditorTexture2DContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
993
- _inherits(EditorTexture2DContentRestorer, ContentRestorer);
994
- function EditorTexture2DContentRestorer(resource, url, requestConfig) {
995
- var _this;
996
- _this = ContentRestorer.call(this, resource) || this, _this.url = url, _this.requestConfig = requestConfig;
997
- return _this;
998
- }
999
- var _proto = EditorTexture2DContentRestorer.prototype;
1000
- _proto.restoreContent = function restoreContent() {
1001
- var texture = this.resource;
1002
- var engine = texture.engine;
1003
- return engine.resourceManager// @ts-ignore
1004
- ._request(this.url, this.requestConfig).then(function(data) {
1005
- return decode(data, engine, texture);
1006
- });
1007
- };
1008
- return EditorTexture2DContentRestorer;
1009
- }(engineCore.ContentRestorer);
1010
-
1011
964
  function _instanceof(left, right) {
1012
965
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
1013
966
  return !!right[Symbol.hasInstance](left);
@@ -1265,6 +1218,7 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1265
1218
  var transform = entityConfig.transform;
1266
1219
  var entity = new engineCore.Entity(engine, entityConfig.name, transform ? engineCore.Loader.getClass(transform.class) : engineCore.Transform);
1267
1220
  if (!entityConfig.parent) this.context.rootIds.push(entityConfig.id);
1221
+ this._addEntityPlugin(entityConfig.id, entity);
1268
1222
  return Promise.resolve(entity);
1269
1223
  };
1270
1224
  _proto._parsePrefab = function _parsePrefab(entityConfig, engine) {
@@ -1328,6 +1282,7 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1328
1282
  var component = entity.addComponent(engineCore.Loader.getClass(key));
1329
1283
  componentMap.set(componentId, component);
1330
1284
  componentConfigMap.set(componentId, componentConfig);
1285
+ this._addComponentPlugin(componentId, component);
1331
1286
  }
1332
1287
  };
1333
1288
  _proto._applyEntityData = function _applyEntityData(entity, entityConfig) {
@@ -1384,9 +1339,58 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1384
1339
  }
1385
1340
  return Promise.all(promises);
1386
1341
  };
1342
+ _proto._addComponentPlugin = function _addComponentPlugin(componentId, component) {};
1343
+ _proto._addEntityPlugin = function _addEntityPlugin(entityId, entity) {};
1387
1344
  return HierarchyParser;
1388
1345
  }();
1389
1346
 
1347
+ exports.EditorTextureLoader = /*#__PURE__*/ function(Loader) {
1348
+ _inherits(EditorTextureLoader, Loader);
1349
+ function EditorTextureLoader() {
1350
+ return Loader.apply(this, arguments) || this;
1351
+ }
1352
+ var _proto = EditorTextureLoader.prototype;
1353
+ _proto.load = function load(item, resourceManager) {
1354
+ var requestConfig = _extends({}, item, {
1355
+ type: "arraybuffer"
1356
+ });
1357
+ var url = item.url;
1358
+ return new engineCore.AssetPromise(function(resolve, reject) {
1359
+ resourceManager// @ts-ignore
1360
+ ._request(url, requestConfig).then(function(data) {
1361
+ decode(data, resourceManager.engine).then(function(texture) {
1362
+ resourceManager.addContentRestorer(new EditorTexture2DContentRestorer(texture, url, requestConfig));
1363
+ resolve(texture);
1364
+ });
1365
+ }).catch(reject);
1366
+ });
1367
+ };
1368
+ return EditorTextureLoader;
1369
+ }(engineCore.Loader);
1370
+ exports.EditorTextureLoader = __decorate([
1371
+ engineCore.resourceLoader("EditorTexture2D", [
1372
+ "prefab"
1373
+ ], true)
1374
+ ], exports.EditorTextureLoader);
1375
+ var EditorTexture2DContentRestorer = /*#__PURE__*/ function(ContentRestorer) {
1376
+ _inherits(EditorTexture2DContentRestorer, ContentRestorer);
1377
+ function EditorTexture2DContentRestorer(resource, url, requestConfig) {
1378
+ var _this;
1379
+ _this = ContentRestorer.call(this, resource) || this, _this.url = url, _this.requestConfig = requestConfig;
1380
+ return _this;
1381
+ }
1382
+ var _proto = EditorTexture2DContentRestorer.prototype;
1383
+ _proto.restoreContent = function restoreContent() {
1384
+ var texture = this.resource;
1385
+ var engine = texture.engine;
1386
+ return engine.resourceManager// @ts-ignore
1387
+ ._request(this.url, this.requestConfig).then(function(data) {
1388
+ return decode(data, engine, texture);
1389
+ });
1390
+ };
1391
+ return EditorTexture2DContentRestorer;
1392
+ }(engineCore.ContentRestorer);
1393
+
1390
1394
  /** @Internal */ var SceneParser = /*#__PURE__*/ function(HierarchyParser) {
1391
1395
  _inherits(SceneParser, HierarchyParser);
1392
1396
  function SceneParser(data, context, scene) {
@@ -7453,6 +7457,7 @@ exports.GLTFParserContext = GLTFParserContext;
7453
7457
  exports.GLTFParserType = GLTFParserType;
7454
7458
  exports.GLTFResource = GLTFResource;
7455
7459
  exports.GLTFUtils = GLTFUtils;
7460
+ exports.HierarchyParser = HierarchyParser;
7456
7461
  exports.InterpolableValueType = InterpolableValueType;
7457
7462
  exports.KTX2TargetFormat = KTX2TargetFormat;
7458
7463
  exports.KTX2Transcoder = KTX2Transcoder;