@galacean/engine-loader 1.5.15 → 1.5.16
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
|
@@ -1071,6 +1071,25 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
|
|
|
1071
1071
|
/** start parse the scene or prefab or others */ _proto.start = function start() {
|
|
1072
1072
|
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);
|
|
1073
1073
|
};
|
|
1074
|
+
_proto._applyEntityData = function _applyEntityData(entity, entityConfig) {
|
|
1075
|
+
if (entityConfig === void 0) entityConfig = {};
|
|
1076
|
+
var _entityConfig_isActive;
|
|
1077
|
+
entity.isActive = (_entityConfig_isActive = entityConfig.isActive) != null ? _entityConfig_isActive : entity.isActive;
|
|
1078
|
+
var _entityConfig_name;
|
|
1079
|
+
entity.name = (_entityConfig_name = entityConfig.name) != null ? _entityConfig_name : entity.name;
|
|
1080
|
+
var transform = entity.transform;
|
|
1081
|
+
var transformConfig = entityConfig.transform;
|
|
1082
|
+
if (transformConfig) {
|
|
1083
|
+
this._reflectionParser.parsePropsAndMethods(transform, transformConfig);
|
|
1084
|
+
} else {
|
|
1085
|
+
var position = entityConfig.position, rotation = entityConfig.rotation, scale = entityConfig.scale;
|
|
1086
|
+
if (position) transform.position.copyFrom(position);
|
|
1087
|
+
if (rotation) transform.rotation.copyFrom(rotation);
|
|
1088
|
+
if (scale) transform.scale.copyFrom(scale);
|
|
1089
|
+
}
|
|
1090
|
+
if (entityConfig.layer) entity.layer = entityConfig.layer;
|
|
1091
|
+
return entity;
|
|
1092
|
+
};
|
|
1074
1093
|
_proto._parseEntities = function _parseEntities() {
|
|
1075
1094
|
var _this = this;
|
|
1076
1095
|
var entitiesConfig = this.data.entities;
|
|
@@ -1281,25 +1300,6 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
|
|
|
1281
1300
|
this._addComponentPlugin(componentId, component);
|
|
1282
1301
|
}
|
|
1283
1302
|
};
|
|
1284
|
-
_proto._applyEntityData = function _applyEntityData(entity, entityConfig) {
|
|
1285
|
-
if (entityConfig === void 0) entityConfig = {};
|
|
1286
|
-
var _entityConfig_isActive;
|
|
1287
|
-
entity.isActive = (_entityConfig_isActive = entityConfig.isActive) != null ? _entityConfig_isActive : entity.isActive;
|
|
1288
|
-
var _entityConfig_name;
|
|
1289
|
-
entity.name = (_entityConfig_name = entityConfig.name) != null ? _entityConfig_name : entity.name;
|
|
1290
|
-
var transform = entity.transform;
|
|
1291
|
-
var transformConfig = entityConfig.transform;
|
|
1292
|
-
if (transformConfig) {
|
|
1293
|
-
this._reflectionParser.parsePropsAndMethods(transform, transformConfig);
|
|
1294
|
-
} else {
|
|
1295
|
-
var position = entityConfig.position, rotation = entityConfig.rotation, scale = entityConfig.scale;
|
|
1296
|
-
if (position) transform.position.copyFrom(position);
|
|
1297
|
-
if (rotation) transform.rotation.copyFrom(rotation);
|
|
1298
|
-
if (scale) transform.scale.copyFrom(scale);
|
|
1299
|
-
}
|
|
1300
|
-
if (entityConfig.layer) entity.layer = entityConfig.layer;
|
|
1301
|
-
return entity;
|
|
1302
|
-
};
|
|
1303
1303
|
_proto._generateInstanceContext = function _generateInstanceContext(entity, context, path) {
|
|
1304
1304
|
var entityMap = context.entityMap, components = context.components;
|
|
1305
1305
|
var componentsMap = {};
|
|
@@ -5386,6 +5386,13 @@ var PrefabParser = /*#__PURE__*/ function(HierarchyParser) {
|
|
|
5386
5386
|
return _this;
|
|
5387
5387
|
}
|
|
5388
5388
|
var _proto = PrefabParser.prototype;
|
|
5389
|
+
_proto._applyEntityData = function _applyEntityData(entity, entityConfig) {
|
|
5390
|
+
if (entityConfig === void 0) entityConfig = {};
|
|
5391
|
+
HierarchyParser.prototype._applyEntityData.call(this, entity, entityConfig);
|
|
5392
|
+
// @ts-ignore
|
|
5393
|
+
entity._markAsTemplate(this.context.resource);
|
|
5394
|
+
return entity;
|
|
5395
|
+
};
|
|
5389
5396
|
_proto._handleRootEntity = function _handleRootEntity(id) {
|
|
5390
5397
|
this.prefabResource._root = this.context.entityMap.get(id);
|
|
5391
5398
|
};
|