@galacean/effects-specification 2.0.0-alpha.2 → 2.0.0-alpha.3
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/fallback.js +15 -18
- package/dist/fallback.js.map +1 -1
- package/dist/fallback.mjs +15 -18
- package/dist/fallback.mjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/item/effect-item.d.ts +20 -2
- package/package.json +1 -1
package/dist/fallback.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Name: @galacean/effects-specification
|
|
3
3
|
* Description: Galacean Effects JSON Specification
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
|
-
* Version: v2.0.0-alpha.
|
|
5
|
+
* Version: v2.0.0-alpha.3
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
@@ -1541,7 +1541,7 @@ function version22Migration(json) {
|
|
|
1541
1541
|
*/
|
|
1542
1542
|
function version30Migration(json) {
|
|
1543
1543
|
var e_1, _a;
|
|
1544
|
-
var _b, _c, _d, _e;
|
|
1544
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1545
1545
|
var result = Object.assign({}, json, {
|
|
1546
1546
|
items: [],
|
|
1547
1547
|
components: [],
|
|
@@ -1569,15 +1569,15 @@ function version30Migration(json) {
|
|
|
1569
1569
|
}
|
|
1570
1570
|
}
|
|
1571
1571
|
var _loop_1 = function (composition) {
|
|
1572
|
-
var e_2,
|
|
1572
|
+
var e_2, _m, e_3, _o;
|
|
1573
1573
|
// composition 的 endbehaviour 兼容
|
|
1574
1574
|
if (composition.endBehavior === END_BEHAVIOR_PAUSE_AND_DESTROY || composition.endBehavior === END_BEHAVIOR_PAUSE) {
|
|
1575
1575
|
composition.endBehavior = END_BEHAVIOR_FREEZE;
|
|
1576
1576
|
}
|
|
1577
1577
|
var itemGuidMap = {};
|
|
1578
1578
|
try {
|
|
1579
|
-
for (var
|
|
1580
|
-
var item =
|
|
1579
|
+
for (var _p = (e_2 = void 0, __values(composition.items)), _q = _p.next(); !_q.done; _q = _p.next()) {
|
|
1580
|
+
var item = _q.value;
|
|
1581
1581
|
itemGuidMap[item.id] = generateGUID();
|
|
1582
1582
|
// TODO: 编辑器测试用,上线后删除
|
|
1583
1583
|
//@ts-expect-error
|
|
@@ -1588,7 +1588,7 @@ function version30Migration(json) {
|
|
|
1588
1588
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1589
1589
|
finally {
|
|
1590
1590
|
try {
|
|
1591
|
-
if (
|
|
1591
|
+
if (_q && !_q.done && (_m = _p.return)) _m.call(_p);
|
|
1592
1592
|
}
|
|
1593
1593
|
finally { if (e_2) throw e_2.error; }
|
|
1594
1594
|
}
|
|
@@ -1609,8 +1609,8 @@ function version30Migration(json) {
|
|
|
1609
1609
|
composition.items[index] = { id: item.id };
|
|
1610
1610
|
});
|
|
1611
1611
|
try {
|
|
1612
|
-
for (var
|
|
1613
|
-
var item =
|
|
1612
|
+
for (var _r = (e_3 = void 0, __values(result.items)), _s = _r.next(); !_s.done; _s = _r.next()) {
|
|
1613
|
+
var item = _s.value;
|
|
1614
1614
|
// 原 texture 索引转为统一 guid 索引
|
|
1615
1615
|
if (item.content) {
|
|
1616
1616
|
if (item.content.renderer) {
|
|
@@ -1659,13 +1659,10 @@ function version30Migration(json) {
|
|
|
1659
1659
|
var startSize = item.transform.size;
|
|
1660
1660
|
// 兼容旧JSON(anchor和particleOrigin可能同时存在)
|
|
1661
1661
|
if (!renderer.anchor && renderer.particleOrigin !== undefined) {
|
|
1662
|
-
|
|
1663
|
-
item.transform.position.
|
|
1664
|
-
//@ts-expect-error
|
|
1665
|
-
item.transform.position.y += -realAnchor[1] * startSize.y;
|
|
1662
|
+
item.transform.position.x += -realAnchor[0] * ((_f = startSize === null || startSize === void 0 ? void 0 : startSize.x) !== null && _f !== void 0 ? _f : 1);
|
|
1663
|
+
item.transform.position.y += -realAnchor[1] * ((_g = startSize === null || startSize === void 0 ? void 0 : startSize.y) !== null && _g !== void 0 ? _g : 1);
|
|
1666
1664
|
}
|
|
1667
|
-
|
|
1668
|
-
item.transform.anchor = { x: realAnchor[0] * startSize.x, y: realAnchor[1] * startSize.y };
|
|
1665
|
+
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) };
|
|
1669
1666
|
}
|
|
1670
1667
|
}
|
|
1671
1668
|
if (item.type === ItemType.particle) {
|
|
@@ -1817,22 +1814,22 @@ function version30Migration(json) {
|
|
|
1817
1814
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1818
1815
|
finally {
|
|
1819
1816
|
try {
|
|
1820
|
-
if (
|
|
1817
|
+
if (_s && !_s.done && (_o = _r.return)) _o.call(_r);
|
|
1821
1818
|
}
|
|
1822
1819
|
finally { if (e_3) throw e_3.error; }
|
|
1823
1820
|
}
|
|
1824
1821
|
};
|
|
1825
1822
|
try {
|
|
1826
1823
|
// 更正Composition.endBehavior
|
|
1827
|
-
for (var
|
|
1828
|
-
var composition =
|
|
1824
|
+
for (var _k = __values(json.compositions), _l = _k.next(); !_l.done; _l = _k.next()) {
|
|
1825
|
+
var composition = _l.value;
|
|
1829
1826
|
_loop_1(composition);
|
|
1830
1827
|
}
|
|
1831
1828
|
}
|
|
1832
1829
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1833
1830
|
finally {
|
|
1834
1831
|
try {
|
|
1835
|
-
if (
|
|
1832
|
+
if (_l && !_l.done && (_a = _k.return)) _a.call(_k);
|
|
1836
1833
|
}
|
|
1837
1834
|
finally { if (e_1) throw e_1.error; }
|
|
1838
1835
|
}
|