@galacean/effects-core 2.3.0-beta.0 → 2.3.0-beta.1

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.mjs 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.3.0-beta.0
6
+ * Version: v2.3.0-beta.1
7
7
  */
8
8
 
9
9
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
@@ -33,6 +33,41 @@ function _async_to_generator(fn) {
33
33
  };
34
34
  }
35
35
 
36
+ function _array_like_to_array(arr, len) {
37
+ if (len == null || len > arr.length) len = arr.length;
38
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
39
+ return arr2;
40
+ }
41
+
42
+ function _unsupported_iterable_to_array(o, minLen) {
43
+ if (!o) return;
44
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
45
+ var n = Object.prototype.toString.call(o).slice(8, -1);
46
+ if (n === "Object" && o.constructor) n = o.constructor.name;
47
+ if (n === "Map" || n === "Set") return Array.from(n);
48
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
49
+ }
50
+
51
+ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
52
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
53
+ if (it) return (it = it.call(o)).next.bind(it);
54
+ // Fallback for engines without symbol support
55
+ if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === "number") {
56
+ if (it) o = it;
57
+ var i = 0;
58
+ return function() {
59
+ if (i >= o.length) return {
60
+ done: true
61
+ };
62
+ return {
63
+ done: false,
64
+ value: o[i++]
65
+ };
66
+ };
67
+ }
68
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
69
+ }
70
+
36
71
  function _instanceof1(left, right) {
37
72
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
38
73
  return !!right[Symbol.hasInstance](left);
@@ -816,16 +851,13 @@ var pluginCtrlMap = {};
816
851
  * @param pluginClass class of plugin
817
852
  * @param itemClass class of item
818
853
  * @param isDefault load
819
- */ // eslint-disable-next-line @typescript-eslint/no-unused-vars
820
- function registerPlugin(name, pluginClass, itemClass, isDefault) {
854
+ */ function registerPlugin(name, pluginClass, itemClass) {
821
855
  if (pluginCtrlMap[name]) {
822
856
  logger.error("Duplicate registration for plugin " + name + ".");
823
857
  }
824
858
  pluginCtrlMap[name] = itemClass;
825
859
  pluginLoaderMap[name] = pluginClass;
826
- if (isDefault) {
827
- addItem(defaultPlugins, name);
828
- }
860
+ addItem(defaultPlugins, name);
829
861
  }
830
862
  function unregisterPlugin(name) {
831
863
  delete pluginCtrlMap[name];
@@ -833,7 +865,7 @@ function unregisterPlugin(name) {
833
865
  removeItem(defaultPlugins, name);
834
866
  }
835
867
  var PluginSystem = /*#__PURE__*/ function() {
836
- function PluginSystem(pluginNames) {
868
+ function PluginSystem() {
837
869
  var loaders = {};
838
870
  var loaded = [];
839
871
  var addLoader = function(name) {
@@ -844,7 +876,6 @@ var PluginSystem = /*#__PURE__*/ function() {
844
876
  }
845
877
  };
846
878
  defaultPlugins.forEach(addLoader);
847
- pluginNames.forEach(addLoader);
848
879
  this.plugins = Object.keys(loaders).map(function(name) {
849
880
  var CTRL = pluginLoaderMap[name];
850
881
  if (!CTRL) {
@@ -896,15 +927,10 @@ var PluginSystem = /*#__PURE__*/ function() {
896
927
  })();
897
928
  };
898
929
  _proto.precompile = function precompile(compositions, renderer, options) {
899
- var _this = this;
900
- return _async_to_generator(function() {
901
- return __generator(this, function(_state) {
902
- return [
903
- 2,
904
- _this.callStatic("precompile", compositions, renderer, options)
905
- ];
906
- });
907
- })();
930
+ for(var _iterator = _create_for_of_iterator_helper_loose(this.plugins), _step; !(_step = _iterator()).done;){
931
+ var plugin = _step.value;
932
+ plugin.precompile(compositions, renderer, options);
933
+ }
908
934
  };
909
935
  _proto.loadResources = function loadResources(scene, options) {
910
936
  var _this = this;
@@ -974,6 +1000,11 @@ function getPluginUsageInfo(name) {
974
1000
  this.name = "";
975
1001
  }
976
1002
  var _proto = AbstractPlugin.prototype;
1003
+ /**
1004
+ * 在加载到 JSON 后,就可以进行提前编译
1005
+ * @param json
1006
+ * @param player
1007
+ */ _proto.precompile = function precompile(compositions, renderer, options) {};
977
1008
  _proto.onCompositionConstructed = function onCompositionConstructed(composition, scene) {};
978
1009
  _proto.onCompositionItemLifeBegin = function onCompositionItemLifeBegin(composition, item) {};
979
1010
  _proto.onCompositionItemLifeEnd = function onCompositionItemLifeEnd(composition, item) {};
@@ -986,13 +1017,6 @@ function getPluginUsageInfo(name) {
986
1017
  return false;
987
1018
  };
988
1019
  _proto.postProcessFrame = function postProcessFrame(composition, frame) {};
989
- /**
990
- * 在加载到 JSON 后,就可以进行提前编译
991
- * @param json
992
- * @param player
993
- */ AbstractPlugin.precompile = function precompile(compositions, renderer) {
994
- return Promise.resolve();
995
- };
996
1020
  return AbstractPlugin;
997
1021
  }();
998
1022
 
@@ -6667,41 +6691,6 @@ function setDefaultTextureFactory(factory) {
6667
6691
  g = factory;
6668
6692
  }
6669
6693
 
6670
- function _array_like_to_array(arr, len) {
6671
- if (len == null || len > arr.length) len = arr.length;
6672
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6673
- return arr2;
6674
- }
6675
-
6676
- function _unsupported_iterable_to_array(o, minLen) {
6677
- if (!o) return;
6678
- if (typeof o === "string") return _array_like_to_array(o, minLen);
6679
- var n = Object.prototype.toString.call(o).slice(8, -1);
6680
- if (n === "Object" && o.constructor) n = o.constructor.name;
6681
- if (n === "Map" || n === "Set") return Array.from(n);
6682
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
6683
- }
6684
-
6685
- function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
6686
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
6687
- if (it) return (it = it.call(o)).next.bind(it);
6688
- // Fallback for engines without symbol support
6689
- if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === "number") {
6690
- if (it) o = it;
6691
- var i = 0;
6692
- return function() {
6693
- if (i >= o.length) return {
6694
- done: true
6695
- };
6696
- return {
6697
- done: false,
6698
- value: o[i++]
6699
- };
6700
- };
6701
- }
6702
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6703
- }
6704
-
6705
6694
  var ShaderCompileResultStatus;
6706
6695
  (function(ShaderCompileResultStatus) {
6707
6696
  ShaderCompileResultStatus[ShaderCompileResultStatus["noShader"] = 0] = "noShader";
@@ -16158,7 +16147,8 @@ vertices, _verticesStride, _verticesOffset, indices, _indicesOffset) {
16158
16147
  var perpY = x0 - x1;
16159
16148
  var perp1x = 0;
16160
16149
  var perp1y = 0;
16161
- var dist = Math.sqrt(perpX * perpX + perpY * perpY);
16150
+ // 计算向量长度并添加极小值 NumberEpsilon 以避免除以零的情况。
16151
+ var dist = Math.sqrt(perpX * perpX + perpY * perpY) + NumberEpsilon;
16162
16152
  perpX /= dist;
16163
16153
  perpY /= dist;
16164
16154
  perpX *= width;
@@ -16185,14 +16175,14 @@ vertices, _verticesStride, _verticesOffset, indices, _indicesOffset) {
16185
16175
  y2 = points[(i + 1) * 2 + 1];
16186
16176
  perpX = -(y0 - y1);
16187
16177
  perpY = x0 - x1;
16188
- dist = Math.sqrt(perpX * perpX + perpY * perpY);
16178
+ dist = Math.sqrt(perpX * perpX + perpY * perpY) + NumberEpsilon;
16189
16179
  perpX /= dist;
16190
16180
  perpY /= dist;
16191
16181
  perpX *= width;
16192
16182
  perpY *= width;
16193
16183
  perp1x = -(y1 - y2);
16194
16184
  perp1y = x1 - x2;
16195
- dist = Math.sqrt(perp1x * perp1x + perp1y * perp1y);
16185
+ dist = Math.sqrt(perp1x * perp1x + perp1y * perp1y) + NumberEpsilon;
16196
16186
  perp1x /= dist;
16197
16187
  perp1y /= dist;
16198
16188
  perp1x *= width;
@@ -16293,7 +16283,7 @@ vertices, _verticesStride, _verticesOffset, indices, _indicesOffset) {
16293
16283
  y1 = points[(length - 1) * 2 + 1];
16294
16284
  perpX = -(y0 - y1);
16295
16285
  perpY = x0 - x1;
16296
- dist = Math.sqrt(perpX * perpX + perpY * perpY);
16286
+ dist = Math.sqrt(perpX * perpX + perpY * perpY) + NumberEpsilon;
16297
16287
  perpX /= dist;
16298
16288
  perpY /= dist;
16299
16289
  perpX *= width;
@@ -16456,7 +16446,7 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
16456
16446
  indices.length;
16457
16447
  var vertOffset1 = vertices.length / 2;
16458
16448
  var lineStyle = this.strokeAttributes;
16459
- var close = false;
16449
+ var close = true;
16460
16450
  if (this.shapeAttribute.type === ShapePrimitiveType.Custom) {
16461
16451
  close = shape1.closePath;
16462
16452
  }
@@ -17577,61 +17567,6 @@ function shouldIgnoreBouncing(arg, mul) {
17577
17567
  return MeshCollider;
17578
17568
  }();
17579
17569
 
17580
- var maxSpriteMeshItemCount = 8;
17581
- function setSpriteMeshMaxItemCountByGPU(gpuCapability) {
17582
- if (gpuCapability.maxVertexUniforms >= 256) {
17583
- return maxSpriteMeshItemCount = 32;
17584
- } else if (gpuCapability.maxVertexUniforms >= 128) {
17585
- return maxSpriteMeshItemCount = 16;
17586
- }
17587
- }
17588
- function spriteMeshShaderFromFilter(level, options) {
17589
- var _ref = options != null ? options : {}, _ref_env = _ref.env, env = _ref_env === void 0 ? "" : _ref_env, wireframe = _ref.wireframe;
17590
- var macros = [
17591
- [
17592
- "ENV_EDITOR",
17593
- env === PLAYER_OPTIONS_ENV_EDITOR
17594
- ]
17595
- ];
17596
- var fragment = wireframe ? itemFrameFrag : itemFrag;
17597
- var vertex = itemVert;
17598
- return {
17599
- fragment: fragment,
17600
- vertex: vertex,
17601
- glslVersion: level === 1 ? GLSLVersion.GLSL1 : GLSLVersion.GLSL3,
17602
- macros: macros,
17603
- shared: true
17604
- };
17605
- }
17606
- function spriteMeshShaderIdFromRenderInfo(renderInfo, count) {
17607
- return renderInfo.cachePrefix + "_effects_sprite_" + count;
17608
- }
17609
- function spriteMeshShaderFromRenderInfo(renderInfo, count, level, env) {
17610
- var wireframe = renderInfo.wireframe;
17611
- var shader = spriteMeshShaderFromFilter(level, {
17612
- wireframe: wireframe,
17613
- env: env
17614
- });
17615
- shader.shared = true;
17616
- // if (!wireframe) {
17617
- // shader.cacheId = spriteMeshShaderIdFromRenderInfo(renderInfo, count);
17618
- // }
17619
- return shader;
17620
- }
17621
- // TODO: 只有单测用
17622
- function setMaxSpriteMeshItemCount(count) {
17623
- maxSpriteMeshItemCount = count;
17624
- }
17625
-
17626
- var defRenderInfo = {
17627
- blending: 0,
17628
- cacheId: "-",
17629
- mask: 0,
17630
- maskMode: 0,
17631
- occlusion: false,
17632
- side: 0,
17633
- cachePrefix: "-"
17634
- };
17635
17570
  var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
17636
17571
  _inherits(SpriteLoader, AbstractPlugin);
17637
17572
  function SpriteLoader() {
@@ -17640,19 +17575,6 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
17640
17575
  _this.name = "sprite";
17641
17576
  return _this;
17642
17577
  }
17643
- SpriteLoader.precompile = function precompile(compositions, render, options) {
17644
- var shaderLibrary = render.getShaderLibrary();
17645
- var _render_engine_gpuCapability = render.engine.gpuCapability, level = _render_engine_gpuCapability.level, detail = _render_engine_gpuCapability.detail;
17646
- var env = (options != null ? options : {}).env;
17647
- if (!(shaderLibrary == null ? void 0 : shaderLibrary.shaderResults[spriteMeshShaderIdFromRenderInfo(defRenderInfo, 2)])) {
17648
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(spriteMeshShaderFromRenderInfo(defRenderInfo, 2, 1, env));
17649
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(spriteMeshShaderFromRenderInfo(defRenderInfo, maxSpriteMeshItemCount, 1, env));
17650
- if (detail.writableFragDepth) {
17651
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(createCopyShader(level, true));
17652
- }
17653
- }
17654
- return Promise.resolve();
17655
- };
17656
17578
  return SpriteLoader;
17657
17579
  }(AbstractPlugin);
17658
17580
 
@@ -19854,66 +19776,6 @@ function calculateDirection(prePoint, point, nextPoint) {
19854
19776
  }
19855
19777
  return dir.normalize().toArray();
19856
19778
  }
19857
- function getTrailMeshShader(trails, particleMaxCount, name, gpuCapability, env) {
19858
- if (env === void 0) env = "";
19859
- var shaderCacheId = 0;
19860
- var lookUpTexture = getConfig(RENDER_PREFER_LOOKUP_TEXTURE) ? 1 : 0;
19861
- var enableVertexTexture = gpuCapability.detail.maxVertexTextures > 0;
19862
- var macros = [
19863
- [
19864
- "ENABLE_VERTEX_TEXTURE",
19865
- enableVertexTexture
19866
- ],
19867
- [
19868
- "LOOKUP_TEXTURE_CURVE",
19869
- lookUpTexture
19870
- ],
19871
- [
19872
- "ENV_EDITOR",
19873
- env === PLAYER_OPTIONS_ENV_EDITOR
19874
- ]
19875
- ];
19876
- var keyFrameMeta = createKeyFrameMeta();
19877
- if (trails.colorOverLifetime) {
19878
- macros.push([
19879
- "COLOR_OVER_LIFETIME",
19880
- true
19881
- ]);
19882
- shaderCacheId |= 1;
19883
- }
19884
- if (trails.colorOverTrail) {
19885
- macros.push([
19886
- "COLOR_OVER_TRAIL",
19887
- true
19888
- ]);
19889
- shaderCacheId |= 1 << 2;
19890
- }
19891
- var useAttributeTrailStart = particleMaxCount > 64;
19892
- if (useAttributeTrailStart) {
19893
- macros.push([
19894
- "ATTR_TRAIL_START",
19895
- 1
19896
- ]);
19897
- shaderCacheId |= 1 << 3;
19898
- }
19899
- getKeyFrameMetaByRawValue(keyFrameMeta, trails.opacityOverLifetime);
19900
- getKeyFrameMetaByRawValue(keyFrameMeta, trails.widthOverTrail);
19901
- macros.push([
19902
- "VERT_CURVE_VALUE_COUNT",
19903
- keyFrameMeta.index
19904
- ], [
19905
- "VERT_MAX_KEY_FRAME_COUNT",
19906
- keyFrameMeta.max
19907
- ]);
19908
- return {
19909
- vertex: trailVert,
19910
- fragment: particleFrag,
19911
- macros: macros,
19912
- shared: true,
19913
- name: "trail#" + name,
19914
- cacheId: "-t:+" + shaderCacheId + "+" + keyFrameMeta.index + "+" + keyFrameMeta.max
19915
- };
19916
- }
19917
19779
 
19918
19780
  /**
19919
19781
  * @since 2.0.0
@@ -24937,59 +24799,57 @@ SpriteComponent = __decorate([
24937
24799
  effectsClass(DataType.SpriteComponent)
24938
24800
  ], SpriteComponent);
24939
24801
 
24802
+ var maxSpriteMeshItemCount = 8;
24803
+ function setSpriteMeshMaxItemCountByGPU(gpuCapability) {
24804
+ if (gpuCapability.maxVertexUniforms >= 256) {
24805
+ return maxSpriteMeshItemCount = 32;
24806
+ } else if (gpuCapability.maxVertexUniforms >= 128) {
24807
+ return maxSpriteMeshItemCount = 16;
24808
+ }
24809
+ }
24810
+ function spriteMeshShaderFromFilter(level, options) {
24811
+ var _ref = options != null ? options : {}, _ref_env = _ref.env, env = _ref_env === void 0 ? "" : _ref_env, wireframe = _ref.wireframe;
24812
+ var macros = [
24813
+ [
24814
+ "ENV_EDITOR",
24815
+ env === PLAYER_OPTIONS_ENV_EDITOR
24816
+ ]
24817
+ ];
24818
+ var fragment = wireframe ? itemFrameFrag : itemFrag;
24819
+ var vertex = itemVert;
24820
+ return {
24821
+ fragment: fragment,
24822
+ vertex: vertex,
24823
+ glslVersion: level === 1 ? GLSLVersion.GLSL1 : GLSLVersion.GLSL3,
24824
+ macros: macros,
24825
+ shared: true
24826
+ };
24827
+ }
24828
+ function spriteMeshShaderIdFromRenderInfo(renderInfo, count) {
24829
+ return renderInfo.cachePrefix + "_effects_sprite_" + count;
24830
+ }
24831
+ function spriteMeshShaderFromRenderInfo(renderInfo, count, level, env) {
24832
+ var wireframe = renderInfo.wireframe;
24833
+ var shader = spriteMeshShaderFromFilter(level, {
24834
+ wireframe: wireframe,
24835
+ env: env
24836
+ });
24837
+ shader.shared = true;
24838
+ // if (!wireframe) {
24839
+ // shader.cacheId = spriteMeshShaderIdFromRenderInfo(renderInfo, count);
24840
+ // }
24841
+ return shader;
24842
+ }
24843
+ // TODO: 只有单测用
24844
+ function setMaxSpriteMeshItemCount(count) {
24845
+ maxSpriteMeshItemCount = count;
24846
+ }
24847
+
24940
24848
  var ParticleLoader = /*#__PURE__*/ function(AbstractPlugin) {
24941
24849
  _inherits(ParticleLoader, AbstractPlugin);
24942
24850
  function ParticleLoader() {
24943
24851
  return AbstractPlugin.apply(this, arguments);
24944
24852
  }
24945
- ParticleLoader.precompile = function precompile(compositions, renderer, options) {
24946
- var gpuCapability = renderer.engine.gpuCapability;
24947
- var level = gpuCapability.level;
24948
- var env = (options != null ? options : {}).env;
24949
- var shaderLibrary = renderer.getShaderLibrary();
24950
- var items = [];
24951
- var shaders = [];
24952
- var maxFragmentCount = 0;
24953
- var maxVertexCount = 0;
24954
- // 增加预合成中的粒子处理
24955
- compositions.forEach(function(comp) {
24956
- comp.items.forEach(function(item) {
24957
- if (Item.isParticle(item)) {
24958
- items.push(item);
24959
- }
24960
- });
24961
- });
24962
- items.forEach(function(item) {
24963
- var _getParticleMeshShader = getParticleMeshShader(item, gpuCapability, env), shader = _getParticleMeshShader.shader, fragment = _getParticleMeshShader.fragment, vertex = _getParticleMeshShader.vertex;
24964
- shaders.push(shader);
24965
- maxFragmentCount = Math.max(maxFragmentCount, fragment);
24966
- maxVertexCount = Math.max(maxVertexCount, vertex);
24967
- // TODO 此处add是否有意义?shader变量似乎没有加到this.shaders数组。
24968
- if (item.content.trails) {
24969
- var shader1 = getTrailMeshShader(item.content.trails, item.content.options.maxCount, item.name, gpuCapability, env);
24970
- shader1.glslVersion = level === 2 ? GLSLVersion.GLSL3 : GLSLVersion.GLSL1;
24971
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(shader1);
24972
- }
24973
- });
24974
- shaders.forEach(function(shader) {
24975
- if (level === 2) {
24976
- modifyMaxKeyframeShader(shader, maxVertexCount, maxFragmentCount);
24977
- shader.glslVersion = GLSLVersion.GLSL3;
24978
- } else {
24979
- shader.glslVersion = GLSLVersion.GLSL1;
24980
- }
24981
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(shader);
24982
- });
24983
- if (level === 2) {
24984
- items.forEach(function(item) {
24985
- item.content.options.meshSlots = [
24986
- maxVertexCount,
24987
- maxFragmentCount
24988
- ];
24989
- });
24990
- }
24991
- return Promise.resolve();
24992
- };
24993
24853
  return ParticleLoader;
24994
24854
  }(AbstractPlugin);
24995
24855
 
@@ -28167,7 +28027,7 @@ var seed = 1;
28167
28027
  });
28168
28028
  });
28169
28029
  loadResourcePromise = /*#__PURE__*/ _async_to_generator(function() {
28170
- var scene, link, jsonScene, pluginSystem, loadedImages, compositions, images, _ref, jsonScene1, pluginSystem1, _jsonScene_bins, bins, images1, compositions1, fonts, _ref1, loadedBins, loadedImages1, loadedTextures, totalTime;
28030
+ var scene, link, jsonScene, pluginSystem, loadedImages, images, _ref, jsonScene1, pluginSystem1, _jsonScene_bins, bins, images1, fonts, _ref1, loadedBins, loadedImages1, loadedTextures, totalTime;
28171
28031
  return __generator(this, function(_state) {
28172
28032
  switch(_state.label){
28173
28033
  case 0:
@@ -28203,16 +28063,13 @@ var seed = 1;
28203
28063
  // 已经加载过的 可能需要更新数据模板
28204
28064
  scene = _extends({}, rawJSON);
28205
28065
  jsonScene = scene.jsonScene, pluginSystem = scene.pluginSystem, loadedImages = scene.images;
28206
- compositions = jsonScene.compositions, images = jsonScene.images;
28066
+ images = jsonScene.images;
28207
28067
  _this.assignImagesToAssets(images, loadedImages);
28208
28068
  return [
28209
28069
  4,
28210
28070
  Promise.all([
28211
28071
  hookTimeInfo("plugin:processAssets", function() {
28212
28072
  return _this.processPluginAssets(jsonScene, pluginSystem, options);
28213
- }),
28214
- hookTimeInfo("plugin:precompile", function() {
28215
- return _this.precompile(compositions, pluginSystem, renderer, options);
28216
28073
  })
28217
28074
  ])
28218
28075
  ];
@@ -28231,7 +28088,7 @@ var seed = 1;
28231
28088
  ];
28232
28089
  case 6:
28233
28090
  _ref = _state.sent(), jsonScene1 = _ref.jsonScene, pluginSystem1 = _ref.pluginSystem;
28234
- _jsonScene_bins = jsonScene1.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins, images1 = jsonScene1.images, compositions1 = jsonScene1.compositions, fonts = jsonScene1.fonts;
28091
+ _jsonScene_bins = jsonScene1.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins, images1 = jsonScene1.images, fonts = jsonScene1.fonts;
28235
28092
  return [
28236
28093
  4,
28237
28094
  Promise.all([
@@ -28244,9 +28101,6 @@ var seed = 1;
28244
28101
  hookTimeInfo("plugin:processAssets", function() {
28245
28102
  return _this.processPluginAssets(jsonScene1, pluginSystem1, options);
28246
28103
  }),
28247
- hookTimeInfo("plugin:precompile", function() {
28248
- return _this.precompile(compositions1, pluginSystem1, renderer, options);
28249
- }),
28250
28104
  hookTimeInfo("processFontURL", function() {
28251
28105
  return _this.processFontURL(fonts);
28252
28106
  })
@@ -28312,39 +28166,15 @@ var seed = 1;
28312
28166
  _proto.getAssets = function getAssets() {
28313
28167
  return this.assets;
28314
28168
  };
28315
- _proto.precompile = function precompile(compositions, pluginSystem, renderer, options) {
28316
- return _async_to_generator(function() {
28317
- return __generator(this, function(_state) {
28318
- switch(_state.label){
28319
- case 0:
28320
- if (!renderer || !renderer.getShaderLibrary()) {
28321
- return [
28322
- 2
28323
- ];
28324
- }
28325
- return [
28326
- 4,
28327
- pluginSystem.precompile(compositions, renderer, options)
28328
- ];
28329
- case 1:
28330
- _state.sent();
28331
- return [
28332
- 2
28333
- ];
28334
- }
28335
- });
28336
- })();
28337
- };
28338
28169
  _proto.processJSON = function processJSON(json) {
28339
28170
  var _this = this;
28340
28171
  return _async_to_generator(function() {
28341
- var jsonScene, _jsonScene_plugins, plugins, pluginSystem;
28172
+ var jsonScene, pluginSystem;
28342
28173
  return __generator(this, function(_state) {
28343
28174
  switch(_state.label){
28344
28175
  case 0:
28345
28176
  jsonScene = getStandardJSON(json);
28346
- _jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins;
28347
- pluginSystem = new PluginSystem(plugins);
28177
+ pluginSystem = new PluginSystem();
28348
28178
  return [
28349
28179
  4,
28350
28180
  pluginSystem.processRawJSON(jsonScene, _this.options)
@@ -28856,7 +28686,6 @@ function createTextureOptionsBySource(image, sourceFrom, id) {
28856
28686
  }
28857
28687
  var _proto = AssetService.prototype;
28858
28688
  /**
28859
- * @internal
28860
28689
  * @param url
28861
28690
  * @param options
28862
28691
  * @returns
@@ -28881,7 +28710,6 @@ function createTextureOptionsBySource(image, sourceFrom, id) {
28881
28710
  * 根据用户参数修改文本元素的原始数据
28882
28711
  * @param scene
28883
28712
  * @param options
28884
- * @internal
28885
28713
  */ _proto.updateTextVariables = function updateTextVariables(scene, variables) {
28886
28714
  var _this = this;
28887
28715
  if (variables === void 0) variables = {};
@@ -32232,13 +32060,13 @@ var DEFAULT_FPS = 60;
32232
32060
  return Ticker;
32233
32061
  }();
32234
32062
 
32235
- registerPlugin("camera", CameraVFXItemLoader, VFXItem, true);
32236
- registerPlugin("text", TextLoader, VFXItem, true);
32237
- registerPlugin("sprite", SpriteLoader, VFXItem, true);
32238
- registerPlugin("particle", ParticleLoader, VFXItem, true);
32239
- registerPlugin("cal", CalculateLoader, VFXItem, true);
32240
- registerPlugin("interact", InteractLoader, VFXItem, true);
32241
- var version = "2.3.0-beta.0";
32063
+ registerPlugin("camera", CameraVFXItemLoader, VFXItem);
32064
+ registerPlugin("text", TextLoader, VFXItem);
32065
+ registerPlugin("sprite", SpriteLoader, VFXItem);
32066
+ registerPlugin("particle", ParticleLoader, VFXItem);
32067
+ registerPlugin("cal", CalculateLoader, VFXItem);
32068
+ registerPlugin("interact", InteractLoader, VFXItem);
32069
+ var version = "2.3.0-beta.1";
32242
32070
  logger.info("Core version: " + version + ".");
32243
32071
 
32244
32072
  export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, AssetService, BYTES_TYPE_MAP, BaseRenderComponent, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, ColorPropertyPlayableAsset, ColorPropertyTrack, Component, Composition, CompositionComponent, CompositionSourceManager, DEFAULT_FONTS, DEFAULT_FPS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, EffectsPackage, Engine, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent, FilterMode, Float16ArrayWrapper, FloatPropertyPlayableAsset, FloatPropertyTrack, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, MaterialTrack, Mesh, MeshCollider, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, ParticleTrack, PassTextureCache, PathSegments, PluginSystem, PostProcessVolume, PropertyTrack, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, Scene, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, ShapeComponent, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, Vector2Curve, Vector2PropertyPlayableAsset, Vector2PropertyTrack, Vector4Curve, Vector4PropertyPlayableAsset, Vector4PropertyTrack, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, decimalEqual, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isCanvas, isFunction, isIOS, isIOSByUA, isMiniProgram, isObject, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemFrameFrag, itemVert, loadAVIFOptional, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, normalizeColor, numberToFix, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, passRenderLevel, pluginLoaderMap, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };