@galacean/effects-threejs 2.0.0-alpha.4 → 2.0.0-alpha.5

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 threejs plugin for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v2.0.0-alpha.4
6
+ * Version: v2.0.0-alpha.5
7
7
  */
8
8
 
9
9
  'use strict';
@@ -6598,7 +6598,7 @@ function generateGUID$1() {
6598
6598
  * Name: @galacean/effects-specification
6599
6599
  * Description: Galacean Effects JSON Specification
6600
6600
  * Author: Ant Group CO., Ltd.
6601
- * Version: v2.0.0-alpha.2
6601
+ * Version: v2.0.0-alpha.3
6602
6602
  */
6603
6603
 
6604
6604
  typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
@@ -21132,7 +21132,7 @@ function getPluginUsageInfo(name) {
21132
21132
  * Name: @galacean/effects-specification
21133
21133
  * Description: Galacean Effects JSON Specification
21134
21134
  * Author: Ant Group CO., Ltd.
21135
- * Version: v2.0.0-alpha.2
21135
+ * Version: v2.0.0-alpha.3
21136
21136
  */
21137
21137
 
21138
21138
  const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
@@ -22667,7 +22667,7 @@ function version22Migration(json) {
22667
22667
  */
22668
22668
  function version30Migration(json) {
22669
22669
  var e_1, _a;
22670
- var _b, _c, _d, _e;
22670
+ var _b, _c, _d, _e, _f, _g, _h, _j;
22671
22671
  var result = Object.assign({}, json, {
22672
22672
  items: [],
22673
22673
  components: [],
@@ -22695,15 +22695,15 @@ function version30Migration(json) {
22695
22695
  }
22696
22696
  }
22697
22697
  var _loop_1 = function (composition) {
22698
- var e_2, _h, e_3, _j;
22698
+ var e_2, _m, e_3, _o;
22699
22699
  // composition 的 endbehaviour 兼容
22700
22700
  if (composition.endBehavior === END_BEHAVIOR_PAUSE_AND_DESTROY || composition.endBehavior === END_BEHAVIOR_PAUSE) {
22701
22701
  composition.endBehavior = END_BEHAVIOR_FREEZE;
22702
22702
  }
22703
22703
  var itemGuidMap = {};
22704
22704
  try {
22705
- for (var _k = (e_2 = void 0, __values(composition.items)), _l = _k.next(); !_l.done; _l = _k.next()) {
22706
- var item = _l.value;
22705
+ for (var _p = (e_2 = void 0, __values(composition.items)), _q = _p.next(); !_q.done; _q = _p.next()) {
22706
+ var item = _q.value;
22707
22707
  itemGuidMap[item.id] = generateGUID();
22708
22708
  // TODO: 编辑器测试用,上线后删除
22709
22709
  //@ts-expect-error
@@ -22714,7 +22714,7 @@ function version30Migration(json) {
22714
22714
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
22715
22715
  finally {
22716
22716
  try {
22717
- if (_l && !_l.done && (_h = _k.return)) _h.call(_k);
22717
+ if (_q && !_q.done && (_m = _p.return)) _m.call(_p);
22718
22718
  }
22719
22719
  finally { if (e_2) throw e_2.error; }
22720
22720
  }
@@ -22735,8 +22735,8 @@ function version30Migration(json) {
22735
22735
  composition.items[index] = { id: item.id };
22736
22736
  });
22737
22737
  try {
22738
- for (var _m = (e_3 = void 0, __values(result.items)), _o = _m.next(); !_o.done; _o = _m.next()) {
22739
- var item = _o.value;
22738
+ for (var _r = (e_3 = void 0, __values(result.items)), _s = _r.next(); !_s.done; _s = _r.next()) {
22739
+ var item = _s.value;
22740
22740
  // 原 texture 索引转为统一 guid 索引
22741
22741
  if (item.content) {
22742
22742
  if (item.content.renderer) {
@@ -22785,13 +22785,10 @@ function version30Migration(json) {
22785
22785
  var startSize = item.transform.size;
22786
22786
  // 兼容旧JSON(anchor和particleOrigin可能同时存在)
22787
22787
  if (!renderer.anchor && renderer.particleOrigin !== undefined) {
22788
- //@ts-expect-error
22789
- item.transform.position.x += -realAnchor[0] * startSize.x;
22790
- //@ts-expect-error
22791
- item.transform.position.y += -realAnchor[1] * startSize.y;
22788
+ item.transform.position.x += -realAnchor[0] * ((_f = startSize === null || startSize === void 0 ? void 0 : startSize.x) !== null && _f !== void 0 ? _f : 1);
22789
+ item.transform.position.y += -realAnchor[1] * ((_g = startSize === null || startSize === void 0 ? void 0 : startSize.y) !== null && _g !== void 0 ? _g : 1);
22792
22790
  }
22793
- //@ts-expect-error
22794
- item.transform.anchor = { x: realAnchor[0] * startSize.x, y: realAnchor[1] * startSize.y };
22791
+ item.transform.anchor = { x: realAnchor[0] * ((_h = startSize === null || startSize === void 0 ? void 0 : startSize.x) !== null && _h !== void 0 ? _h : 1), y: realAnchor[1] * ((_j = startSize === null || startSize === void 0 ? void 0 : startSize.y) !== null && _j !== void 0 ? _j : 1) };
22795
22792
  }
22796
22793
  }
22797
22794
  if (item.type === ItemType.particle) {
@@ -22943,22 +22940,22 @@ function version30Migration(json) {
22943
22940
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
22944
22941
  finally {
22945
22942
  try {
22946
- if (_o && !_o.done && (_j = _m.return)) _j.call(_m);
22943
+ if (_s && !_s.done && (_o = _r.return)) _o.call(_r);
22947
22944
  }
22948
22945
  finally { if (e_3) throw e_3.error; }
22949
22946
  }
22950
22947
  };
22951
22948
  try {
22952
22949
  // 更正Composition.endBehavior
22953
- for (var _f = __values(json.compositions), _g = _f.next(); !_g.done; _g = _f.next()) {
22954
- var composition = _g.value;
22950
+ for (var _k = __values(json.compositions), _l = _k.next(); !_l.done; _l = _k.next()) {
22951
+ var composition = _l.value;
22955
22952
  _loop_1(composition);
22956
22953
  }
22957
22954
  }
22958
22955
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
22959
22956
  finally {
22960
22957
  try {
22961
- if (_g && !_g.done && (_a = _f.return)) _a.call(_f);
22958
+ if (_l && !_l.done && (_a = _k.return)) _a.call(_k);
22962
22959
  }
22963
22960
  finally { if (e_1) throw e_1.error; }
22964
22961
  }
@@ -28116,7 +28113,7 @@ Geometry.create = function (engine, options) {
28116
28113
  Mesh.create = function (engine, props) {
28117
28114
  return new ThreeMesh(engine, props);
28118
28115
  };
28119
- var version = "2.0.0-alpha.4";
28116
+ var version = "2.0.0-alpha.5";
28120
28117
  logger.info('THREEJS plugin version: ' + version);
28121
28118
 
28122
28119
  exports.AbstractPlugin = AbstractPlugin;