@galacean/engine-loader 1.6.11 → 1.6.13

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
@@ -1085,6 +1085,25 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1085
1085
  /** start parse the scene or prefab or others */ _proto.start = function start() {
1086
1086
  this._parseEntities().then(this._organizeEntities).then(this._parseComponents).then(this._parseAddedComponents).then(this._parseComponentsPropsAndMethods).then(this._parsePrefabModification).then(this._parsePrefabRemovedEntities).then(this._parsePrefabRemovedComponents).then(this._clearAndResolve).then(this._resolve).catch(this._reject);
1087
1087
  };
1088
+ _proto._applyEntityData = function _applyEntityData(entity, entityConfig) {
1089
+ if (entityConfig === void 0) entityConfig = {};
1090
+ var _entityConfig_isActive;
1091
+ entity.isActive = (_entityConfig_isActive = entityConfig.isActive) != null ? _entityConfig_isActive : entity.isActive;
1092
+ var _entityConfig_name;
1093
+ entity.name = (_entityConfig_name = entityConfig.name) != null ? _entityConfig_name : entity.name;
1094
+ var transform = entity.transform;
1095
+ var transformConfig = entityConfig.transform;
1096
+ if (transformConfig) {
1097
+ this._reflectionParser.parsePropsAndMethods(transform, transformConfig);
1098
+ } else {
1099
+ var position = entityConfig.position, rotation = entityConfig.rotation, scale = entityConfig.scale;
1100
+ if (position) transform.position.copyFrom(position);
1101
+ if (rotation) transform.rotation.copyFrom(rotation);
1102
+ if (scale) transform.scale.copyFrom(scale);
1103
+ }
1104
+ if (entityConfig.layer) entity.layer = entityConfig.layer;
1105
+ return entity;
1106
+ };
1088
1107
  _proto._parseEntities = function _parseEntities() {
1089
1108
  var _this = this;
1090
1109
  var entitiesConfig = this.data.entities;
@@ -1295,25 +1314,6 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1295
1314
  this._addComponentPlugin(componentId, component);
1296
1315
  }
1297
1316
  };
1298
- _proto._applyEntityData = function _applyEntityData(entity, entityConfig) {
1299
- if (entityConfig === void 0) entityConfig = {};
1300
- var _entityConfig_isActive;
1301
- entity.isActive = (_entityConfig_isActive = entityConfig.isActive) != null ? _entityConfig_isActive : entity.isActive;
1302
- var _entityConfig_name;
1303
- entity.name = (_entityConfig_name = entityConfig.name) != null ? _entityConfig_name : entity.name;
1304
- var transform = entity.transform;
1305
- var transformConfig = entityConfig.transform;
1306
- if (transformConfig) {
1307
- this._reflectionParser.parsePropsAndMethods(transform, transformConfig);
1308
- } else {
1309
- var position = entityConfig.position, rotation = entityConfig.rotation, scale = entityConfig.scale;
1310
- if (position) transform.position.copyFrom(position);
1311
- if (rotation) transform.rotation.copyFrom(rotation);
1312
- if (scale) transform.scale.copyFrom(scale);
1313
- }
1314
- if (entityConfig.layer) entity.layer = entityConfig.layer;
1315
- return entity;
1316
- };
1317
1317
  _proto._generateInstanceContext = function _generateInstanceContext(entity, context, path) {
1318
1318
  var entityMap = context.entityMap, components = context.components;
1319
1319
  var componentsMap = {};
@@ -5259,6 +5259,13 @@ var PrefabParser = /*#__PURE__*/ function(HierarchyParser) {
5259
5259
  return _this;
5260
5260
  }
5261
5261
  var _proto = PrefabParser.prototype;
5262
+ _proto._applyEntityData = function _applyEntityData(entity, entityConfig) {
5263
+ if (entityConfig === void 0) entityConfig = {};
5264
+ HierarchyParser.prototype._applyEntityData.call(this, entity, entityConfig);
5265
+ // @ts-ignore
5266
+ entity._markAsTemplate(this.context.resource);
5267
+ return entity;
5268
+ };
5262
5269
  _proto._handleRootEntity = function _handleRootEntity(id) {
5263
5270
  this.prefabResource._root = this.context.entityMap.get(id);
5264
5271
  };
@@ -6520,6 +6527,7 @@ var AudioLoader = /*#__PURE__*/ function(Loader) {
6520
6527
  // @ts-ignore
6521
6528
  resourceManager._request(url, requestConfig).then(function(arrayBuffer) {
6522
6529
  var audioClip = new AudioClip(resourceManager.engine);
6530
+ // @ts-ignore
6523
6531
  AudioManager.getContext().decodeAudioData(arrayBuffer).then(function(result) {
6524
6532
  // @ts-ignore
6525
6533
  audioClip._setAudioSource(result);