@galacean/effects-core 2.4.5 → 2.4.7

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/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime core for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v2.4.5
6
+ * Version: v2.4.7
7
7
  */
8
8
 
9
9
  'use strict';
@@ -19077,8 +19077,6 @@ exports.ParticleSystem = /*#__PURE__*/ function(Component) {
19077
19077
  finish = true;
19078
19078
  }
19079
19079
  }
19080
- } else {
19081
- break;
19082
19080
  }
19083
19081
  // @ts-expect-error
19084
19082
  }while ((node = node.pre) && !finish);
@@ -21141,13 +21139,12 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
21141
21139
  _this._textures = [];
21142
21140
  var _props_reusable = props.reusable, reusable = _props_reusable === void 0 ? false : _props_reusable, _props_speed = props.speed, speed = _props_speed === void 0 ? 1 : _props_speed, _props_baseRenderOrder = props.baseRenderOrder, baseRenderOrder = _props_baseRenderOrder === void 0 ? 0 : _props_baseRenderOrder, renderer = props.renderer, event = props.event, width = props.width, height = props.height, handleItemMessage = props.handleItemMessage;
21143
21141
  _this.renderer = renderer;
21144
- _this._textures = scene.textureOptions;
21142
+ _this._textures = scene.textures;
21145
21143
  var _scene_jsonScene_renderSettings_postProcessingEnabled;
21146
21144
  _this.postProcessingEnabled = (_scene_jsonScene_renderSettings_postProcessingEnabled = (_scene_jsonScene_renderSettings = scene.jsonScene.renderSettings) == null ? void 0 : _scene_jsonScene_renderSettings.postProcessingEnabled) != null ? _scene_jsonScene_renderSettings_postProcessingEnabled : false;
21147
21145
  _this.getEngine().renderLevel = scene.renderLevel;
21148
21146
  if (reusable) {
21149
21147
  _this.keepResource = true;
21150
- scene.textures = undefined;
21151
21148
  scene.consumed = true;
21152
21149
  }
21153
21150
  var sourceContent = scene.jsonScene.compositions[0];
@@ -26264,8 +26261,9 @@ var TextComponentBase = /*#__PURE__*/ function() {
26264
26261
  this.isDirty = true;
26265
26262
  };
26266
26263
  /**
26267
- * 设置字体类型
26268
- * @param value 字体类型
26264
+ * 设置字体样式
26265
+ * @param value 设置字体样式
26266
+ * @default "normal"
26269
26267
  * @returns
26270
26268
  */ _proto.setFontStyle = function setFontStyle(value) {
26271
26269
  if (this.textStyle.fontStyle === value) {
@@ -27416,7 +27414,6 @@ function getStandardInteractContent(ui) {
27416
27414
  var currentMaskComponent;
27417
27415
  var componentMap = new Map();
27418
27416
  var itemMap = new Map();
27419
- var refCompositions = new Map();
27420
27417
  /**
27421
27418
  * 3.1 版本数据适配
27422
27419
  * - 富文本插件名称的适配
@@ -27464,27 +27461,20 @@ var refCompositions = new Map();
27464
27461
  function version32Migration(json) {
27465
27462
  componentMap.clear();
27466
27463
  itemMap.clear();
27467
- refCompositions.clear();
27468
27464
  var compositions = json.compositions, items = json.items, components = json.components;
27469
27465
  // 处理旧蒙版数据
27470
- var mainComp = compositions[0];
27471
27466
  for(var _iterator = _create_for_of_iterator_helper_loose(components), _step; !(_step = _iterator()).done;){
27472
27467
  var component = _step.value;
27473
27468
  componentMap.set(component.id, component);
27474
27469
  }
27475
- for(var _iterator1 = _create_for_of_iterator_helper_loose(compositions), _step1; !(_step1 = _iterator1()).done;){
27476
- var comp = _step1.value;
27477
- if (comp.id === json.compositionId) {
27478
- mainComp = comp;
27479
- } else {
27480
- refCompositions.set(comp.id, comp);
27481
- }
27482
- }
27483
- for(var _iterator2 = _create_for_of_iterator_helper_loose(items), _step2; !(_step2 = _iterator2()).done;){
27484
- var item = _step2.value;
27470
+ for(var _iterator1 = _create_for_of_iterator_helper_loose(items), _step1; !(_step1 = _iterator1()).done;){
27471
+ var item = _step1.value;
27485
27472
  itemMap.set(item.id, item);
27486
27473
  }
27487
- processContent(mainComp);
27474
+ for(var _iterator2 = _create_for_of_iterator_helper_loose(compositions), _step2; !(_step2 = _iterator2()).done;){
27475
+ var comp = _step2.value;
27476
+ processContent(comp);
27477
+ }
27488
27478
  return json;
27489
27479
  }
27490
27480
  function version33Migration(json) {
@@ -27569,12 +27559,6 @@ function processContent(composition) {
27569
27559
  processMask(component);
27570
27560
  }
27571
27561
  }
27572
- // 处理预合成的渲染顺序
27573
- if (itemProps.type === ItemType.composition) {
27574
- var refId = itemProps.content.options.refId;
27575
- var comp = refCompositions.get(refId);
27576
- comp && processContent(comp);
27577
- }
27578
27562
  }
27579
27563
  }
27580
27564
  function processMask(renderContent) {
@@ -28963,7 +28947,7 @@ var seed = 1;
28963
28947
  });
28964
28948
  });
28965
28949
  loadResourcePromise = /*#__PURE__*/ _async_to_generator(function() {
28966
- var scene, link, jsonScene, pluginSystem, loadedImages, images, _ref, jsonScene1, pluginSystem1, _jsonScene_bins, bins, images1, fonts, _ref1, loadedBins, loadedImages1, loadedTextures, totalTime;
28950
+ var scene, link, _ref, jsonScene, pluginSystem, _jsonScene_bins, bins, images, fonts, _ref1, loadedBins, loadedImages, loadedTextures, totalTime;
28967
28951
  return __generator(this, function(_state) {
28968
28952
  switch(_state.label){
28969
28953
  case 0:
@@ -28994,37 +28978,23 @@ var seed = 1;
28994
28978
  case 3:
28995
28979
  if (!exports.Scene.isJSONObject(rawJSON)) return [
28996
28980
  3,
28997
- 5
28981
+ 4
28998
28982
  ];
28999
- // 已经加载过的 可能需要更新数据模板
29000
28983
  scene = _extends({}, rawJSON);
29001
- jsonScene = scene.jsonScene, pluginSystem = scene.pluginSystem, loadedImages = scene.images;
29002
- images = jsonScene.images;
29003
- _this.assignImagesToAssets(images, loadedImages);
29004
- return [
29005
- 4,
29006
- Promise.all([
29007
- hookTimeInfo("plugin:processAssets", function() {
29008
- return _this.processPluginAssets(jsonScene, pluginSystem, options);
29009
- })
29010
- ])
29011
- ];
29012
- case 4:
29013
- _state.sent();
29014
28984
  return [
29015
28985
  3,
29016
- 10
28986
+ 9
29017
28987
  ];
29018
- case 5:
28988
+ case 4:
29019
28989
  return [
29020
28990
  4,
29021
28991
  hookTimeInfo("processJSON", function() {
29022
28992
  return _this.processJSON(rawJSON);
29023
28993
  })
29024
28994
  ];
29025
- case 6:
29026
- _ref = _state.sent(), jsonScene1 = _ref.jsonScene, pluginSystem1 = _ref.pluginSystem;
29027
- _jsonScene_bins = jsonScene1.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins, images1 = jsonScene1.images, fonts = jsonScene1.fonts;
28995
+ case 5:
28996
+ _ref = _state.sent(), jsonScene = _ref.jsonScene, pluginSystem = _ref.pluginSystem;
28997
+ _jsonScene_bins = jsonScene.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins, images = jsonScene.images, fonts = jsonScene.fonts;
29028
28998
  return [
29029
28999
  4,
29030
29000
  Promise.all([
@@ -29032,48 +29002,50 @@ var seed = 1;
29032
29002
  return _this.processBins(bins);
29033
29003
  }),
29034
29004
  hookTimeInfo("processImages", function() {
29035
- return _this.processImages(images1, compressedTexture);
29005
+ return _this.processImages(images, compressedTexture);
29036
29006
  }),
29037
29007
  hookTimeInfo("plugin:processAssets", function() {
29038
- return _this.processPluginAssets(jsonScene1, pluginSystem1, options);
29008
+ return _this.processPluginAssets(jsonScene, pluginSystem, options);
29039
29009
  }),
29040
29010
  hookTimeInfo("processFontURL", function() {
29041
29011
  return _this.processFontURL(fonts);
29042
29012
  })
29043
29013
  ])
29044
29014
  ];
29045
- case 7:
29046
- _ref1 = _state.sent(), loadedBins = _ref1[0], loadedImages1 = _ref1[1];
29015
+ case 6:
29016
+ _ref1 = _state.sent(), loadedBins = _ref1[0], loadedImages = _ref1[1];
29047
29017
  return [
29048
29018
  4,
29049
29019
  hookTimeInfo("processTextures", function() {
29050
- return _this.processTextures(loadedImages1, loadedBins, jsonScene1);
29020
+ return _this.processTextures(loadedImages, loadedBins, jsonScene);
29051
29021
  })
29052
29022
  ];
29053
- case 8:
29023
+ case 7:
29054
29024
  loadedTextures = _state.sent();
29055
29025
  scene = {
29056
29026
  timeInfos: timeInfos,
29057
29027
  url: url,
29058
29028
  renderLevel: _this.options.renderLevel,
29059
29029
  storage: {},
29060
- pluginSystem: pluginSystem1,
29061
- jsonScene: jsonScene1,
29030
+ pluginSystem: pluginSystem,
29031
+ jsonScene: jsonScene,
29062
29032
  bins: loadedBins,
29063
- images: loadedImages1,
29064
- textureOptions: loadedTextures
29033
+ textureOptions: loadedTextures,
29034
+ textures: [],
29035
+ images: loadedImages,
29036
+ assets: _this.assets
29065
29037
  };
29066
29038
  // 触发插件系统 pluginSystem 的回调 prepareResource
29067
29039
  return [
29068
29040
  4,
29069
29041
  hookTimeInfo("plugin:prepareResource", function() {
29070
- return pluginSystem1.loadResources(scene, _this.options);
29042
+ return pluginSystem.loadResources(scene, _this.options);
29071
29043
  })
29072
29044
  ];
29073
- case 9:
29045
+ case 8:
29074
29046
  _state.sent();
29075
- _state.label = 10;
29076
- case 10:
29047
+ _state.label = 9;
29048
+ case 9:
29077
29049
  totalTime = performance.now() - startTime;
29078
29050
  logger.info("Load asset: totalTime: " + totalTime.toFixed(4) + "ms " + timeInfoMessages.join(" ") + ", url: " + assetUrl + ".");
29079
29051
  window.clearTimeout(loadTimer);
@@ -29668,16 +29640,10 @@ function createTextureOptionsBySource(image, sourceFrom, id) {
29668
29640
  };
29669
29641
  _proto.initializeTexture = function initializeTexture(scene) {
29670
29642
  for(var i = 0; i < scene.textureOptions.length; i++){
29671
- var textureOptions = scene.textureOptions[i];
29672
- if (_instanceof1(textureOptions, Texture)) {
29673
- this.engine.addInstance(textureOptions);
29674
- } else {
29675
- textureOptions = this.engine.findObject({
29676
- id: scene.textureOptions[i].id
29677
- });
29678
- scene.textureOptions[i] = textureOptions;
29679
- }
29680
- textureOptions.initialize();
29643
+ scene.textures[i] = this.engine.findObject({
29644
+ id: scene.textureOptions[i].id
29645
+ });
29646
+ scene.textures[i].initialize();
29681
29647
  }
29682
29648
  };
29683
29649
  _proto.prepareAssets = function prepareAssets(scene, assets) {
@@ -31662,7 +31628,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
31662
31628
  registerPlugin("particle", ParticleLoader, exports.VFXItem);
31663
31629
  registerPlugin("cal", CalculateLoader, exports.VFXItem);
31664
31630
  registerPlugin("interact", InteractLoader, exports.VFXItem);
31665
- var version = "2.4.5";
31631
+ var version = "2.4.7";
31666
31632
  logger.info("Core version: " + version + ".");
31667
31633
 
31668
31634
  exports.AbstractPlugin = AbstractPlugin;