@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.
@@ -54,7 +54,6 @@ export declare class AssetManager implements Disposable {
54
54
  env: string;
55
55
  }): Promise<Scene>;
56
56
  getAssets(): Record<string, ImageLike>;
57
- private precompile;
58
57
  private processJSON;
59
58
  private processBins;
60
59
  private processFontURL;
@@ -1,6 +1,7 @@
1
+ import * as spec from '@galacean/effects-specification';
1
2
  import type { Disposable } from './utils';
2
3
  import type { Engine } from './engine';
3
- import type { ImageLike } from './scene';
4
+ import type { ImageLike, SceneLoadOptions } from './scene';
4
5
  import { Scene } from './scene';
5
6
  /**
6
7
  *
@@ -13,6 +14,21 @@ export declare class AssetService implements Disposable {
13
14
  * @param engine
14
15
  */
15
16
  constructor(engine: Engine);
17
+ /**
18
+ * @param url
19
+ * @param options
20
+ * @returns
21
+ */
22
+ assembleSceneLoadOptions(url: Scene.LoadType, options?: SceneLoadOptions): {
23
+ source: Scene.LoadType;
24
+ options: SceneLoadOptions;
25
+ };
26
+ /**
27
+ * 根据用户参数修改文本元素的原始数据
28
+ * @param scene
29
+ * @param options
30
+ */
31
+ updateTextVariables(scene: Scene, variables?: spec.TemplateVariables): void;
16
32
  initializeTexture(scene: Scene): void;
17
33
  prepareAssets(scene: Scene, assets: Record<string, ImageLike>): void;
18
34
  createShaderVariant(): void;
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.3.0-beta.0
6
+ * Version: v2.3.0-beta.1
7
7
  */
8
8
 
9
9
  'use strict';
@@ -37,6 +37,41 @@ function _async_to_generator(fn) {
37
37
  };
38
38
  }
39
39
 
40
+ function _array_like_to_array(arr, len) {
41
+ if (len == null || len > arr.length) len = arr.length;
42
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
43
+ return arr2;
44
+ }
45
+
46
+ function _unsupported_iterable_to_array(o, minLen) {
47
+ if (!o) return;
48
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
49
+ var n = Object.prototype.toString.call(o).slice(8, -1);
50
+ if (n === "Object" && o.constructor) n = o.constructor.name;
51
+ if (n === "Map" || n === "Set") return Array.from(n);
52
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
53
+ }
54
+
55
+ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
56
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
57
+ if (it) return (it = it.call(o)).next.bind(it);
58
+ // Fallback for engines without symbol support
59
+ if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === "number") {
60
+ if (it) o = it;
61
+ var i = 0;
62
+ return function() {
63
+ if (i >= o.length) return {
64
+ done: true
65
+ };
66
+ return {
67
+ done: false,
68
+ value: o[i++]
69
+ };
70
+ };
71
+ }
72
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
73
+ }
74
+
40
75
  function _instanceof1(left, right) {
41
76
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
42
77
  return !!right[Symbol.hasInstance](left);
@@ -820,16 +855,13 @@ var pluginCtrlMap = {};
820
855
  * @param pluginClass class of plugin
821
856
  * @param itemClass class of item
822
857
  * @param isDefault load
823
- */ // eslint-disable-next-line @typescript-eslint/no-unused-vars
824
- function registerPlugin(name, pluginClass, itemClass, isDefault) {
858
+ */ function registerPlugin(name, pluginClass, itemClass) {
825
859
  if (pluginCtrlMap[name]) {
826
860
  logger.error("Duplicate registration for plugin " + name + ".");
827
861
  }
828
862
  pluginCtrlMap[name] = itemClass;
829
863
  pluginLoaderMap[name] = pluginClass;
830
- if (isDefault) {
831
- addItem(defaultPlugins, name);
832
- }
864
+ addItem(defaultPlugins, name);
833
865
  }
834
866
  function unregisterPlugin(name) {
835
867
  delete pluginCtrlMap[name];
@@ -837,7 +869,7 @@ function unregisterPlugin(name) {
837
869
  removeItem(defaultPlugins, name);
838
870
  }
839
871
  var PluginSystem = /*#__PURE__*/ function() {
840
- function PluginSystem(pluginNames) {
872
+ function PluginSystem() {
841
873
  var loaders = {};
842
874
  var loaded = [];
843
875
  var addLoader = function(name) {
@@ -848,7 +880,6 @@ var PluginSystem = /*#__PURE__*/ function() {
848
880
  }
849
881
  };
850
882
  defaultPlugins.forEach(addLoader);
851
- pluginNames.forEach(addLoader);
852
883
  this.plugins = Object.keys(loaders).map(function(name) {
853
884
  var CTRL = pluginLoaderMap[name];
854
885
  if (!CTRL) {
@@ -900,15 +931,10 @@ var PluginSystem = /*#__PURE__*/ function() {
900
931
  })();
901
932
  };
902
933
  _proto.precompile = function precompile(compositions, renderer, options) {
903
- var _this = this;
904
- return _async_to_generator(function() {
905
- return __generator(this, function(_state) {
906
- return [
907
- 2,
908
- _this.callStatic("precompile", compositions, renderer, options)
909
- ];
910
- });
911
- })();
934
+ for(var _iterator = _create_for_of_iterator_helper_loose(this.plugins), _step; !(_step = _iterator()).done;){
935
+ var plugin = _step.value;
936
+ plugin.precompile(compositions, renderer, options);
937
+ }
912
938
  };
913
939
  _proto.loadResources = function loadResources(scene, options) {
914
940
  var _this = this;
@@ -978,6 +1004,11 @@ function getPluginUsageInfo(name) {
978
1004
  this.name = "";
979
1005
  }
980
1006
  var _proto = AbstractPlugin.prototype;
1007
+ /**
1008
+ * 在加载到 JSON 后,就可以进行提前编译
1009
+ * @param json
1010
+ * @param player
1011
+ */ _proto.precompile = function precompile(compositions, renderer, options) {};
981
1012
  _proto.onCompositionConstructed = function onCompositionConstructed(composition, scene) {};
982
1013
  _proto.onCompositionItemLifeBegin = function onCompositionItemLifeBegin(composition, item) {};
983
1014
  _proto.onCompositionItemLifeEnd = function onCompositionItemLifeEnd(composition, item) {};
@@ -990,13 +1021,6 @@ function getPluginUsageInfo(name) {
990
1021
  return false;
991
1022
  };
992
1023
  _proto.postProcessFrame = function postProcessFrame(composition, frame) {};
993
- /**
994
- * 在加载到 JSON 后,就可以进行提前编译
995
- * @param json
996
- * @param player
997
- */ AbstractPlugin.precompile = function precompile(compositions, renderer) {
998
- return Promise.resolve();
999
- };
1000
1024
  return AbstractPlugin;
1001
1025
  }();
1002
1026
 
@@ -6671,41 +6695,6 @@ function setDefaultTextureFactory(factory) {
6671
6695
  g = factory;
6672
6696
  }
6673
6697
 
6674
- function _array_like_to_array(arr, len) {
6675
- if (len == null || len > arr.length) len = arr.length;
6676
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6677
- return arr2;
6678
- }
6679
-
6680
- function _unsupported_iterable_to_array(o, minLen) {
6681
- if (!o) return;
6682
- if (typeof o === "string") return _array_like_to_array(o, minLen);
6683
- var n = Object.prototype.toString.call(o).slice(8, -1);
6684
- if (n === "Object" && o.constructor) n = o.constructor.name;
6685
- if (n === "Map" || n === "Set") return Array.from(n);
6686
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
6687
- }
6688
-
6689
- function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
6690
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
6691
- if (it) return (it = it.call(o)).next.bind(it);
6692
- // Fallback for engines without symbol support
6693
- if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === "number") {
6694
- if (it) o = it;
6695
- var i = 0;
6696
- return function() {
6697
- if (i >= o.length) return {
6698
- done: true
6699
- };
6700
- return {
6701
- done: false,
6702
- value: o[i++]
6703
- };
6704
- };
6705
- }
6706
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6707
- }
6708
-
6709
6698
  exports.ShaderCompileResultStatus = void 0;
6710
6699
  (function(ShaderCompileResultStatus) {
6711
6700
  ShaderCompileResultStatus[ShaderCompileResultStatus["noShader"] = 0] = "noShader";
@@ -16162,7 +16151,8 @@ vertices, _verticesStride, _verticesOffset, indices, _indicesOffset) {
16162
16151
  var perpY = x0 - x1;
16163
16152
  var perp1x = 0;
16164
16153
  var perp1y = 0;
16165
- var dist = Math.sqrt(perpX * perpX + perpY * perpY);
16154
+ // 计算向量长度并添加极小值 NumberEpsilon 以避免除以零的情况。
16155
+ var dist = Math.sqrt(perpX * perpX + perpY * perpY) + NumberEpsilon;
16166
16156
  perpX /= dist;
16167
16157
  perpY /= dist;
16168
16158
  perpX *= width;
@@ -16189,14 +16179,14 @@ vertices, _verticesStride, _verticesOffset, indices, _indicesOffset) {
16189
16179
  y2 = points[(i + 1) * 2 + 1];
16190
16180
  perpX = -(y0 - y1);
16191
16181
  perpY = x0 - x1;
16192
- dist = Math.sqrt(perpX * perpX + perpY * perpY);
16182
+ dist = Math.sqrt(perpX * perpX + perpY * perpY) + NumberEpsilon;
16193
16183
  perpX /= dist;
16194
16184
  perpY /= dist;
16195
16185
  perpX *= width;
16196
16186
  perpY *= width;
16197
16187
  perp1x = -(y1 - y2);
16198
16188
  perp1y = x1 - x2;
16199
- dist = Math.sqrt(perp1x * perp1x + perp1y * perp1y);
16189
+ dist = Math.sqrt(perp1x * perp1x + perp1y * perp1y) + NumberEpsilon;
16200
16190
  perp1x /= dist;
16201
16191
  perp1y /= dist;
16202
16192
  perp1x *= width;
@@ -16297,7 +16287,7 @@ vertices, _verticesStride, _verticesOffset, indices, _indicesOffset) {
16297
16287
  y1 = points[(length - 1) * 2 + 1];
16298
16288
  perpX = -(y0 - y1);
16299
16289
  perpY = x0 - x1;
16300
- dist = Math.sqrt(perpX * perpX + perpY * perpY);
16290
+ dist = Math.sqrt(perpX * perpX + perpY * perpY) + NumberEpsilon;
16301
16291
  perpX /= dist;
16302
16292
  perpY /= dist;
16303
16293
  perpX *= width;
@@ -16460,7 +16450,7 @@ exports.ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
16460
16450
  indices.length;
16461
16451
  var vertOffset1 = vertices.length / 2;
16462
16452
  var lineStyle = this.strokeAttributes;
16463
- var close = false;
16453
+ var close = true;
16464
16454
  if (this.shapeAttribute.type === ShapePrimitiveType.Custom) {
16465
16455
  close = shape1.closePath;
16466
16456
  }
@@ -17581,61 +17571,6 @@ function shouldIgnoreBouncing(arg, mul) {
17581
17571
  return MeshCollider;
17582
17572
  }();
17583
17573
 
17584
- exports.maxSpriteMeshItemCount = 8;
17585
- function setSpriteMeshMaxItemCountByGPU(gpuCapability) {
17586
- if (gpuCapability.maxVertexUniforms >= 256) {
17587
- return exports.maxSpriteMeshItemCount = 32;
17588
- } else if (gpuCapability.maxVertexUniforms >= 128) {
17589
- return exports.maxSpriteMeshItemCount = 16;
17590
- }
17591
- }
17592
- function spriteMeshShaderFromFilter(level, options) {
17593
- var _ref = options != null ? options : {}, _ref_env = _ref.env, env = _ref_env === void 0 ? "" : _ref_env, wireframe = _ref.wireframe;
17594
- var macros = [
17595
- [
17596
- "ENV_EDITOR",
17597
- env === PLAYER_OPTIONS_ENV_EDITOR
17598
- ]
17599
- ];
17600
- var fragment = wireframe ? itemFrameFrag : itemFrag;
17601
- var vertex = itemVert;
17602
- return {
17603
- fragment: fragment,
17604
- vertex: vertex,
17605
- glslVersion: level === 1 ? exports.GLSLVersion.GLSL1 : exports.GLSLVersion.GLSL3,
17606
- macros: macros,
17607
- shared: true
17608
- };
17609
- }
17610
- function spriteMeshShaderIdFromRenderInfo(renderInfo, count) {
17611
- return renderInfo.cachePrefix + "_effects_sprite_" + count;
17612
- }
17613
- function spriteMeshShaderFromRenderInfo(renderInfo, count, level, env) {
17614
- var wireframe = renderInfo.wireframe;
17615
- var shader = spriteMeshShaderFromFilter(level, {
17616
- wireframe: wireframe,
17617
- env: env
17618
- });
17619
- shader.shared = true;
17620
- // if (!wireframe) {
17621
- // shader.cacheId = spriteMeshShaderIdFromRenderInfo(renderInfo, count);
17622
- // }
17623
- return shader;
17624
- }
17625
- // TODO: 只有单测用
17626
- function setMaxSpriteMeshItemCount(count) {
17627
- exports.maxSpriteMeshItemCount = count;
17628
- }
17629
-
17630
- var defRenderInfo = {
17631
- blending: 0,
17632
- cacheId: "-",
17633
- mask: 0,
17634
- maskMode: 0,
17635
- occlusion: false,
17636
- side: 0,
17637
- cachePrefix: "-"
17638
- };
17639
17574
  var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
17640
17575
  _inherits(SpriteLoader, AbstractPlugin);
17641
17576
  function SpriteLoader() {
@@ -17644,19 +17579,6 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
17644
17579
  _this.name = "sprite";
17645
17580
  return _this;
17646
17581
  }
17647
- SpriteLoader.precompile = function precompile(compositions, render, options) {
17648
- var shaderLibrary = render.getShaderLibrary();
17649
- var _render_engine_gpuCapability = render.engine.gpuCapability, level = _render_engine_gpuCapability.level, detail = _render_engine_gpuCapability.detail;
17650
- var env = (options != null ? options : {}).env;
17651
- if (!(shaderLibrary == null ? void 0 : shaderLibrary.shaderResults[spriteMeshShaderIdFromRenderInfo(defRenderInfo, 2)])) {
17652
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(spriteMeshShaderFromRenderInfo(defRenderInfo, 2, 1, env));
17653
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(spriteMeshShaderFromRenderInfo(defRenderInfo, exports.maxSpriteMeshItemCount, 1, env));
17654
- if (detail.writableFragDepth) {
17655
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(createCopyShader(level, true));
17656
- }
17657
- }
17658
- return Promise.resolve();
17659
- };
17660
17582
  return SpriteLoader;
17661
17583
  }(AbstractPlugin);
17662
17584
 
@@ -19858,66 +19780,6 @@ function calculateDirection(prePoint, point, nextPoint) {
19858
19780
  }
19859
19781
  return dir.normalize().toArray();
19860
19782
  }
19861
- function getTrailMeshShader(trails, particleMaxCount, name, gpuCapability, env) {
19862
- if (env === void 0) env = "";
19863
- var shaderCacheId = 0;
19864
- var lookUpTexture = getConfig(RENDER_PREFER_LOOKUP_TEXTURE) ? 1 : 0;
19865
- var enableVertexTexture = gpuCapability.detail.maxVertexTextures > 0;
19866
- var macros = [
19867
- [
19868
- "ENABLE_VERTEX_TEXTURE",
19869
- enableVertexTexture
19870
- ],
19871
- [
19872
- "LOOKUP_TEXTURE_CURVE",
19873
- lookUpTexture
19874
- ],
19875
- [
19876
- "ENV_EDITOR",
19877
- env === PLAYER_OPTIONS_ENV_EDITOR
19878
- ]
19879
- ];
19880
- var keyFrameMeta = createKeyFrameMeta();
19881
- if (trails.colorOverLifetime) {
19882
- macros.push([
19883
- "COLOR_OVER_LIFETIME",
19884
- true
19885
- ]);
19886
- shaderCacheId |= 1;
19887
- }
19888
- if (trails.colorOverTrail) {
19889
- macros.push([
19890
- "COLOR_OVER_TRAIL",
19891
- true
19892
- ]);
19893
- shaderCacheId |= 1 << 2;
19894
- }
19895
- var useAttributeTrailStart = particleMaxCount > 64;
19896
- if (useAttributeTrailStart) {
19897
- macros.push([
19898
- "ATTR_TRAIL_START",
19899
- 1
19900
- ]);
19901
- shaderCacheId |= 1 << 3;
19902
- }
19903
- getKeyFrameMetaByRawValue(keyFrameMeta, trails.opacityOverLifetime);
19904
- getKeyFrameMetaByRawValue(keyFrameMeta, trails.widthOverTrail);
19905
- macros.push([
19906
- "VERT_CURVE_VALUE_COUNT",
19907
- keyFrameMeta.index
19908
- ], [
19909
- "VERT_MAX_KEY_FRAME_COUNT",
19910
- keyFrameMeta.max
19911
- ]);
19912
- return {
19913
- vertex: trailVert,
19914
- fragment: particleFrag,
19915
- macros: macros,
19916
- shared: true,
19917
- name: "trail#" + name,
19918
- cacheId: "-t:+" + shaderCacheId + "+" + keyFrameMeta.index + "+" + keyFrameMeta.max
19919
- };
19920
- }
19921
19783
 
19922
19784
  /**
19923
19785
  * @since 2.0.0
@@ -24941,59 +24803,57 @@ exports.SpriteComponent = __decorate([
24941
24803
  effectsClass(DataType.SpriteComponent)
24942
24804
  ], exports.SpriteComponent);
24943
24805
 
24806
+ exports.maxSpriteMeshItemCount = 8;
24807
+ function setSpriteMeshMaxItemCountByGPU(gpuCapability) {
24808
+ if (gpuCapability.maxVertexUniforms >= 256) {
24809
+ return exports.maxSpriteMeshItemCount = 32;
24810
+ } else if (gpuCapability.maxVertexUniforms >= 128) {
24811
+ return exports.maxSpriteMeshItemCount = 16;
24812
+ }
24813
+ }
24814
+ function spriteMeshShaderFromFilter(level, options) {
24815
+ var _ref = options != null ? options : {}, _ref_env = _ref.env, env = _ref_env === void 0 ? "" : _ref_env, wireframe = _ref.wireframe;
24816
+ var macros = [
24817
+ [
24818
+ "ENV_EDITOR",
24819
+ env === PLAYER_OPTIONS_ENV_EDITOR
24820
+ ]
24821
+ ];
24822
+ var fragment = wireframe ? itemFrameFrag : itemFrag;
24823
+ var vertex = itemVert;
24824
+ return {
24825
+ fragment: fragment,
24826
+ vertex: vertex,
24827
+ glslVersion: level === 1 ? exports.GLSLVersion.GLSL1 : exports.GLSLVersion.GLSL3,
24828
+ macros: macros,
24829
+ shared: true
24830
+ };
24831
+ }
24832
+ function spriteMeshShaderIdFromRenderInfo(renderInfo, count) {
24833
+ return renderInfo.cachePrefix + "_effects_sprite_" + count;
24834
+ }
24835
+ function spriteMeshShaderFromRenderInfo(renderInfo, count, level, env) {
24836
+ var wireframe = renderInfo.wireframe;
24837
+ var shader = spriteMeshShaderFromFilter(level, {
24838
+ wireframe: wireframe,
24839
+ env: env
24840
+ });
24841
+ shader.shared = true;
24842
+ // if (!wireframe) {
24843
+ // shader.cacheId = spriteMeshShaderIdFromRenderInfo(renderInfo, count);
24844
+ // }
24845
+ return shader;
24846
+ }
24847
+ // TODO: 只有单测用
24848
+ function setMaxSpriteMeshItemCount(count) {
24849
+ exports.maxSpriteMeshItemCount = count;
24850
+ }
24851
+
24944
24852
  var ParticleLoader = /*#__PURE__*/ function(AbstractPlugin) {
24945
24853
  _inherits(ParticleLoader, AbstractPlugin);
24946
24854
  function ParticleLoader() {
24947
24855
  return AbstractPlugin.apply(this, arguments);
24948
24856
  }
24949
- ParticleLoader.precompile = function precompile(compositions, renderer, options) {
24950
- var gpuCapability = renderer.engine.gpuCapability;
24951
- var level = gpuCapability.level;
24952
- var env = (options != null ? options : {}).env;
24953
- var shaderLibrary = renderer.getShaderLibrary();
24954
- var items = [];
24955
- var shaders = [];
24956
- var maxFragmentCount = 0;
24957
- var maxVertexCount = 0;
24958
- // 增加预合成中的粒子处理
24959
- compositions.forEach(function(comp) {
24960
- comp.items.forEach(function(item) {
24961
- if (exports.Item.isParticle(item)) {
24962
- items.push(item);
24963
- }
24964
- });
24965
- });
24966
- items.forEach(function(item) {
24967
- var _getParticleMeshShader = getParticleMeshShader(item, gpuCapability, env), shader = _getParticleMeshShader.shader, fragment = _getParticleMeshShader.fragment, vertex = _getParticleMeshShader.vertex;
24968
- shaders.push(shader);
24969
- maxFragmentCount = Math.max(maxFragmentCount, fragment);
24970
- maxVertexCount = Math.max(maxVertexCount, vertex);
24971
- // TODO 此处add是否有意义?shader变量似乎没有加到this.shaders数组。
24972
- if (item.content.trails) {
24973
- var shader1 = getTrailMeshShader(item.content.trails, item.content.options.maxCount, item.name, gpuCapability, env);
24974
- shader1.glslVersion = level === 2 ? exports.GLSLVersion.GLSL3 : exports.GLSLVersion.GLSL1;
24975
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(shader1);
24976
- }
24977
- });
24978
- shaders.forEach(function(shader) {
24979
- if (level === 2) {
24980
- modifyMaxKeyframeShader(shader, maxVertexCount, maxFragmentCount);
24981
- shader.glslVersion = exports.GLSLVersion.GLSL3;
24982
- } else {
24983
- shader.glslVersion = exports.GLSLVersion.GLSL1;
24984
- }
24985
- shaderLibrary == null ? void 0 : shaderLibrary.addShader(shader);
24986
- });
24987
- if (level === 2) {
24988
- items.forEach(function(item) {
24989
- item.content.options.meshSlots = [
24990
- maxVertexCount,
24991
- maxFragmentCount
24992
- ];
24993
- });
24994
- }
24995
- return Promise.resolve();
24996
- };
24997
24857
  return ParticleLoader;
24998
24858
  }(AbstractPlugin);
24999
24859
 
@@ -28171,7 +28031,7 @@ var seed = 1;
28171
28031
  });
28172
28032
  });
28173
28033
  loadResourcePromise = /*#__PURE__*/ _async_to_generator(function() {
28174
- var scene, link, jsonScene, pluginSystem, loadedImages, compositions, images, _ref, jsonScene1, pluginSystem1, _jsonScene_bins, bins, images1, compositions1, fonts, _ref1, loadedBins, loadedImages1, loadedTextures, totalTime;
28034
+ var scene, link, jsonScene, pluginSystem, loadedImages, images, _ref, jsonScene1, pluginSystem1, _jsonScene_bins, bins, images1, fonts, _ref1, loadedBins, loadedImages1, loadedTextures, totalTime;
28175
28035
  return __generator(this, function(_state) {
28176
28036
  switch(_state.label){
28177
28037
  case 0:
@@ -28207,16 +28067,13 @@ var seed = 1;
28207
28067
  // 已经加载过的 可能需要更新数据模板
28208
28068
  scene = _extends({}, rawJSON);
28209
28069
  jsonScene = scene.jsonScene, pluginSystem = scene.pluginSystem, loadedImages = scene.images;
28210
- compositions = jsonScene.compositions, images = jsonScene.images;
28070
+ images = jsonScene.images;
28211
28071
  _this.assignImagesToAssets(images, loadedImages);
28212
28072
  return [
28213
28073
  4,
28214
28074
  Promise.all([
28215
28075
  hookTimeInfo("plugin:processAssets", function() {
28216
28076
  return _this.processPluginAssets(jsonScene, pluginSystem, options);
28217
- }),
28218
- hookTimeInfo("plugin:precompile", function() {
28219
- return _this.precompile(compositions, pluginSystem, renderer, options);
28220
28077
  })
28221
28078
  ])
28222
28079
  ];
@@ -28235,7 +28092,7 @@ var seed = 1;
28235
28092
  ];
28236
28093
  case 6:
28237
28094
  _ref = _state.sent(), jsonScene1 = _ref.jsonScene, pluginSystem1 = _ref.pluginSystem;
28238
- _jsonScene_bins = jsonScene1.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins, images1 = jsonScene1.images, compositions1 = jsonScene1.compositions, fonts = jsonScene1.fonts;
28095
+ _jsonScene_bins = jsonScene1.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins, images1 = jsonScene1.images, fonts = jsonScene1.fonts;
28239
28096
  return [
28240
28097
  4,
28241
28098
  Promise.all([
@@ -28248,9 +28105,6 @@ var seed = 1;
28248
28105
  hookTimeInfo("plugin:processAssets", function() {
28249
28106
  return _this.processPluginAssets(jsonScene1, pluginSystem1, options);
28250
28107
  }),
28251
- hookTimeInfo("plugin:precompile", function() {
28252
- return _this.precompile(compositions1, pluginSystem1, renderer, options);
28253
- }),
28254
28108
  hookTimeInfo("processFontURL", function() {
28255
28109
  return _this.processFontURL(fonts);
28256
28110
  })
@@ -28316,39 +28170,15 @@ var seed = 1;
28316
28170
  _proto.getAssets = function getAssets() {
28317
28171
  return this.assets;
28318
28172
  };
28319
- _proto.precompile = function precompile(compositions, pluginSystem, renderer, options) {
28320
- return _async_to_generator(function() {
28321
- return __generator(this, function(_state) {
28322
- switch(_state.label){
28323
- case 0:
28324
- if (!renderer || !renderer.getShaderLibrary()) {
28325
- return [
28326
- 2
28327
- ];
28328
- }
28329
- return [
28330
- 4,
28331
- pluginSystem.precompile(compositions, renderer, options)
28332
- ];
28333
- case 1:
28334
- _state.sent();
28335
- return [
28336
- 2
28337
- ];
28338
- }
28339
- });
28340
- })();
28341
- };
28342
28173
  _proto.processJSON = function processJSON(json) {
28343
28174
  var _this = this;
28344
28175
  return _async_to_generator(function() {
28345
- var jsonScene, _jsonScene_plugins, plugins, pluginSystem;
28176
+ var jsonScene, pluginSystem;
28346
28177
  return __generator(this, function(_state) {
28347
28178
  switch(_state.label){
28348
28179
  case 0:
28349
28180
  jsonScene = getStandardJSON(json);
28350
- _jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins;
28351
- pluginSystem = new PluginSystem(plugins);
28181
+ pluginSystem = new PluginSystem();
28352
28182
  return [
28353
28183
  4,
28354
28184
  pluginSystem.processRawJSON(jsonScene, _this.options)
@@ -28860,7 +28690,6 @@ function createTextureOptionsBySource(image, sourceFrom, id) {
28860
28690
  }
28861
28691
  var _proto = AssetService.prototype;
28862
28692
  /**
28863
- * @internal
28864
28693
  * @param url
28865
28694
  * @param options
28866
28695
  * @returns
@@ -28885,7 +28714,6 @@ function createTextureOptionsBySource(image, sourceFrom, id) {
28885
28714
  * 根据用户参数修改文本元素的原始数据
28886
28715
  * @param scene
28887
28716
  * @param options
28888
- * @internal
28889
28717
  */ _proto.updateTextVariables = function updateTextVariables(scene, variables) {
28890
28718
  var _this = this;
28891
28719
  if (variables === void 0) variables = {};
@@ -32236,13 +32064,13 @@ var DEFAULT_FPS = 60;
32236
32064
  return Ticker;
32237
32065
  }();
32238
32066
 
32239
- registerPlugin("camera", CameraVFXItemLoader, exports.VFXItem, true);
32240
- registerPlugin("text", TextLoader, exports.VFXItem, true);
32241
- registerPlugin("sprite", SpriteLoader, exports.VFXItem, true);
32242
- registerPlugin("particle", ParticleLoader, exports.VFXItem, true);
32243
- registerPlugin("cal", CalculateLoader, exports.VFXItem, true);
32244
- registerPlugin("interact", InteractLoader, exports.VFXItem, true);
32245
- var version = "2.3.0-beta.0";
32067
+ registerPlugin("camera", CameraVFXItemLoader, exports.VFXItem);
32068
+ registerPlugin("text", TextLoader, exports.VFXItem);
32069
+ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
32070
+ registerPlugin("particle", ParticleLoader, exports.VFXItem);
32071
+ registerPlugin("cal", CalculateLoader, exports.VFXItem);
32072
+ registerPlugin("interact", InteractLoader, exports.VFXItem);
32073
+ var version = "2.3.0-beta.1";
32246
32074
  logger.info("Core version: " + version + ".");
32247
32075
 
32248
32076
  exports.AbstractPlugin = AbstractPlugin;