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