@galacean/effects-threejs 2.8.4 → 2.8.6
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 +26 -16
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +26 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
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.8.
|
|
6
|
+
* Version: v2.8.6
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -23532,8 +23532,20 @@ exports.ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
23532
23532
|
this.destroyed = false;
|
|
23533
23533
|
};
|
|
23534
23534
|
_proto.onStart = function onStart() {
|
|
23535
|
+
var _this = this;
|
|
23535
23536
|
this.startEmit();
|
|
23536
23537
|
this.initEmitterTransform();
|
|
23538
|
+
this.item.on("click", function() {
|
|
23539
|
+
var _this_interaction;
|
|
23540
|
+
if (((_this_interaction = _this.interaction) == null ? void 0 : _this_interaction.behavior) === ParticleInteractionBehavior.removeParticle) {
|
|
23541
|
+
var pointIndex = _this.clickedPoint.content[1];
|
|
23542
|
+
_this.renderer.removeParticlePoint(pointIndex);
|
|
23543
|
+
_this.clearPointTrail(pointIndex);
|
|
23544
|
+
_this.clickedPoint.content = [
|
|
23545
|
+
0
|
|
23546
|
+
];
|
|
23547
|
+
}
|
|
23548
|
+
});
|
|
23537
23549
|
};
|
|
23538
23550
|
_proto.onUpdate = function onUpdate(dt) {
|
|
23539
23551
|
this.update(dt);
|
|
@@ -23636,7 +23648,10 @@ exports.ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
23636
23648
|
this.particleLink.forEach(function(content) {
|
|
23637
23649
|
content[0] -= duration;
|
|
23638
23650
|
content[2] -= duration;
|
|
23639
|
-
|
|
23651
|
+
// TODO 优化粒子销毁逻辑
|
|
23652
|
+
if (content[3]) {
|
|
23653
|
+
content[3].delay -= duration;
|
|
23654
|
+
}
|
|
23640
23655
|
});
|
|
23641
23656
|
this.renderer.minusTimeForLoop(duration);
|
|
23642
23657
|
} else {
|
|
@@ -23728,7 +23743,7 @@ exports.ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
23728
23743
|
var finish = false;
|
|
23729
23744
|
if (node && node.content) {
|
|
23730
23745
|
do {
|
|
23731
|
-
var _node_content = node.content, currentTime = _node_content[0]
|
|
23746
|
+
var _node_content = node.content, currentTime = _node_content[0]; _node_content[2]; var point = _node_content[3];
|
|
23732
23747
|
if (currentTime > this.timePassed) {
|
|
23733
23748
|
var pos = this.getPointPosition(point);
|
|
23734
23749
|
var ray = options.ray;
|
|
@@ -23740,13 +23755,7 @@ exports.ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
23740
23755
|
}, temp);
|
|
23741
23756
|
}
|
|
23742
23757
|
if (pass) {
|
|
23743
|
-
|
|
23744
|
-
renderer.removeParticlePoint(pointIndex);
|
|
23745
|
-
this.clearPointTrail(pointIndex);
|
|
23746
|
-
node.content = [
|
|
23747
|
-
0
|
|
23748
|
-
];
|
|
23749
|
-
}
|
|
23758
|
+
this.clickedPoint = node;
|
|
23750
23759
|
hitPositions.push(pos);
|
|
23751
23760
|
if (!options.multiple) {
|
|
23752
23761
|
finish = true;
|
|
@@ -29365,7 +29374,8 @@ exports.TextComponent = /*#__PURE__*/ function(MaskableGraphic) {
|
|
|
29365
29374
|
var fontSize = style.fontSize * fontScale;
|
|
29366
29375
|
var lineHeight = layout.lineHeight * fontScale;
|
|
29367
29376
|
style.fontDesc = this.getFontDesc(fontSize);
|
|
29368
|
-
|
|
29377
|
+
// 使用 Array.from 正确分割 Unicode 字符(包括 emoji)
|
|
29378
|
+
var char = Array.from(this.text || "");
|
|
29369
29379
|
var baseHeight = 0;
|
|
29370
29380
|
if (layout.autoWidth) {
|
|
29371
29381
|
baseHeight = finalHeight * fontScale;
|
|
@@ -31637,7 +31647,7 @@ function getStandardSpriteContent(sprite, transform) {
|
|
|
31637
31647
|
return ret;
|
|
31638
31648
|
}
|
|
31639
31649
|
|
|
31640
|
-
var version$2 = "2.8.
|
|
31650
|
+
var version$2 = "2.8.6";
|
|
31641
31651
|
var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
|
|
31642
31652
|
var standardVersion = /^(\d+)\.(\d+)$/;
|
|
31643
31653
|
var reverseParticle = false;
|
|
@@ -34697,8 +34707,8 @@ var DEFAULT_FPS = 60;
|
|
|
34697
34707
|
});
|
|
34698
34708
|
this.resetTickers = false;
|
|
34699
34709
|
}
|
|
34700
|
-
for(var
|
|
34701
|
-
var tick =
|
|
34710
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.tickers), _step; !(_step = _iterator()).done;){
|
|
34711
|
+
var tick = _step.value;
|
|
34702
34712
|
tick(this.dt);
|
|
34703
34713
|
}
|
|
34704
34714
|
}
|
|
@@ -35337,7 +35347,7 @@ registerPlugin("text", TextLoader);
|
|
|
35337
35347
|
registerPlugin("sprite", SpriteLoader);
|
|
35338
35348
|
registerPlugin("particle", ParticleLoader);
|
|
35339
35349
|
registerPlugin("interact", InteractLoader);
|
|
35340
|
-
var version$1 = "2.8.
|
|
35350
|
+
var version$1 = "2.8.6";
|
|
35341
35351
|
logger.info("Core version: " + version$1 + ".");
|
|
35342
35352
|
|
|
35343
35353
|
var _obj;
|
|
@@ -36914,7 +36924,7 @@ applyMixins(exports.ThreeTextComponent, [
|
|
|
36914
36924
|
*/ Mesh.create = function(engine, props) {
|
|
36915
36925
|
return new ThreeMesh(engine, props);
|
|
36916
36926
|
};
|
|
36917
|
-
var version = "2.8.
|
|
36927
|
+
var version = "2.8.6";
|
|
36918
36928
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
36919
36929
|
|
|
36920
36930
|
exports.ActivationMixerPlayable = ActivationMixerPlayable;
|