@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/main.js CHANGED
@@ -1089,6 +1089,25 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1089
1089
  /** start parse the scene or prefab or others */ _proto.start = function start() {
1090
1090
  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);
1091
1091
  };
1092
+ _proto._applyEntityData = function _applyEntityData(entity, entityConfig) {
1093
+ if (entityConfig === void 0) entityConfig = {};
1094
+ var _entityConfig_isActive;
1095
+ entity.isActive = (_entityConfig_isActive = entityConfig.isActive) != null ? _entityConfig_isActive : entity.isActive;
1096
+ var _entityConfig_name;
1097
+ entity.name = (_entityConfig_name = entityConfig.name) != null ? _entityConfig_name : entity.name;
1098
+ var transform = entity.transform;
1099
+ var transformConfig = entityConfig.transform;
1100
+ if (transformConfig) {
1101
+ this._reflectionParser.parsePropsAndMethods(transform, transformConfig);
1102
+ } else {
1103
+ var position = entityConfig.position, rotation = entityConfig.rotation, scale = entityConfig.scale;
1104
+ if (position) transform.position.copyFrom(position);
1105
+ if (rotation) transform.rotation.copyFrom(rotation);
1106
+ if (scale) transform.scale.copyFrom(scale);
1107
+ }
1108
+ if (entityConfig.layer) entity.layer = entityConfig.layer;
1109
+ return entity;
1110
+ };
1092
1111
  _proto._parseEntities = function _parseEntities() {
1093
1112
  var _this = this;
1094
1113
  var entitiesConfig = this.data.entities;
@@ -1299,25 +1318,6 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
1299
1318
  this._addComponentPlugin(componentId, component);
1300
1319
  }
1301
1320
  };
1302
- _proto._applyEntityData = function _applyEntityData(entity, entityConfig) {
1303
- if (entityConfig === void 0) entityConfig = {};
1304
- var _entityConfig_isActive;
1305
- entity.isActive = (_entityConfig_isActive = entityConfig.isActive) != null ? _entityConfig_isActive : entity.isActive;
1306
- var _entityConfig_name;
1307
- entity.name = (_entityConfig_name = entityConfig.name) != null ? _entityConfig_name : entity.name;
1308
- var transform = entity.transform;
1309
- var transformConfig = entityConfig.transform;
1310
- if (transformConfig) {
1311
- this._reflectionParser.parsePropsAndMethods(transform, transformConfig);
1312
- } else {
1313
- var position = entityConfig.position, rotation = entityConfig.rotation, scale = entityConfig.scale;
1314
- if (position) transform.position.copyFrom(position);
1315
- if (rotation) transform.rotation.copyFrom(rotation);
1316
- if (scale) transform.scale.copyFrom(scale);
1317
- }
1318
- if (entityConfig.layer) entity.layer = entityConfig.layer;
1319
- return entity;
1320
- };
1321
1321
  _proto._generateInstanceContext = function _generateInstanceContext(entity, context, path) {
1322
1322
  var entityMap = context.entityMap, components = context.components;
1323
1323
  var componentsMap = {};
@@ -5263,6 +5263,13 @@ var PrefabParser = /*#__PURE__*/ function(HierarchyParser) {
5263
5263
  return _this;
5264
5264
  }
5265
5265
  var _proto = PrefabParser.prototype;
5266
+ _proto._applyEntityData = function _applyEntityData(entity, entityConfig) {
5267
+ if (entityConfig === void 0) entityConfig = {};
5268
+ HierarchyParser.prototype._applyEntityData.call(this, entity, entityConfig);
5269
+ // @ts-ignore
5270
+ entity._markAsTemplate(this.context.resource);
5271
+ return entity;
5272
+ };
5266
5273
  _proto._handleRootEntity = function _handleRootEntity(id) {
5267
5274
  this.prefabResource._root = this.context.entityMap.get(id);
5268
5275
  };
@@ -6524,6 +6531,7 @@ var AudioLoader = /*#__PURE__*/ function(Loader) {
6524
6531
  // @ts-ignore
6525
6532
  resourceManager._request(url, requestConfig).then(function(arrayBuffer) {
6526
6533
  var audioClip = new engineCore.AudioClip(resourceManager.engine);
6534
+ // @ts-ignore
6527
6535
  engineCore.AudioManager.getContext().decodeAudioData(arrayBuffer).then(function(result) {
6528
6536
  // @ts-ignore
6529
6537
  audioClip._setAudioSource(result);