@galacean/effects-core 2.1.0-alpha.10 → 2.1.0-alpha.12
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/comp-vfx-item.d.ts +2 -2
- package/dist/components/post-process-volume.d.ts +7 -10
- package/dist/components/shape-component.d.ts +18 -24
- package/dist/composition.d.ts +5 -0
- package/dist/index.js +263 -228
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +271 -235
- package/dist/index.mjs.map +1 -1
- package/dist/material/material.d.ts +4 -1
- package/dist/plugins/cal/playable-graph.d.ts +3 -0
- package/dist/plugins/interact/interact-item.d.ts +3 -1
- package/dist/plugins/text/text-item.d.ts +2 -0
- package/dist/plugins/timeline/playables/activation-mixer-playable.d.ts +0 -2
- package/dist/vfx-item.d.ts +22 -22
- package/package.json +2 -2
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.1.0-alpha.
|
|
6
|
+
* Version: v2.1.0-alpha.12
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -1090,7 +1090,7 @@ function _inherits(subClass, superClass) {
|
|
|
1090
1090
|
})(MaskMode || (MaskMode = {}));
|
|
1091
1091
|
/**
|
|
1092
1092
|
* 发射器形状
|
|
1093
|
-
*/ var ShapeType
|
|
1093
|
+
*/ var ShapeType;
|
|
1094
1094
|
(function(ShapeType) {
|
|
1095
1095
|
/**
|
|
1096
1096
|
* 没有类型
|
|
@@ -1122,7 +1122,7 @@ function _inherits(subClass, superClass) {
|
|
|
1122
1122
|
/**
|
|
1123
1123
|
* 贴图
|
|
1124
1124
|
*/ ShapeType[ShapeType["TEXTURE"] = 9] = "TEXTURE";
|
|
1125
|
-
})(ShapeType
|
|
1125
|
+
})(ShapeType || (ShapeType = {}));
|
|
1126
1126
|
/**
|
|
1127
1127
|
* 插件类型
|
|
1128
1128
|
*/ var PluginType;
|
|
@@ -1773,7 +1773,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
1773
1773
|
get BlendingMode () { return BlendingMode; },
|
|
1774
1774
|
get SideMode () { return SideMode; },
|
|
1775
1775
|
get MaskMode () { return MaskMode; },
|
|
1776
|
-
get ShapeType () { return ShapeType
|
|
1776
|
+
get ShapeType () { return ShapeType; },
|
|
1777
1777
|
get PluginType () { return PluginType; },
|
|
1778
1778
|
get InteractType () { return InteractType; },
|
|
1779
1779
|
get InteractBehavior () { return InteractBehavior; },
|
|
@@ -2019,7 +2019,7 @@ function getDirectStore(target) {
|
|
|
2019
2019
|
this.onAwake();
|
|
2020
2020
|
this.isAwakeCalled = true;
|
|
2021
2021
|
}
|
|
2022
|
-
if (item.
|
|
2022
|
+
if (item.isActive && this.enabled) {
|
|
2023
2023
|
this.start();
|
|
2024
2024
|
this.enable();
|
|
2025
2025
|
}
|
|
@@ -2064,7 +2064,7 @@ function getDirectStore(target) {
|
|
|
2064
2064
|
get: /**
|
|
2065
2065
|
* 组件是否可以更新,true 更新,false 不更新
|
|
2066
2066
|
*/ function get() {
|
|
2067
|
-
return this.item.
|
|
2067
|
+
return this.item.isActive && this.enabled;
|
|
2068
2068
|
}
|
|
2069
2069
|
},
|
|
2070
2070
|
{
|
|
@@ -3766,24 +3766,29 @@ EffectComponent = __decorate([
|
|
|
3766
3766
|
|
|
3767
3767
|
var PostProcessVolume = /*#__PURE__*/ function(Behaviour) {
|
|
3768
3768
|
_inherits(PostProcessVolume, Behaviour);
|
|
3769
|
-
function PostProcessVolume() {
|
|
3769
|
+
function PostProcessVolume(engine) {
|
|
3770
3770
|
var _this;
|
|
3771
|
-
_this = Behaviour.
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
_this.
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
_this.
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3771
|
+
_this = Behaviour.call(this, engine) || this;
|
|
3772
|
+
_this.bloom = {
|
|
3773
|
+
threshold: 0,
|
|
3774
|
+
intensity: 0,
|
|
3775
|
+
active: false
|
|
3776
|
+
};
|
|
3777
|
+
_this.vignette = {
|
|
3778
|
+
intensity: 0,
|
|
3779
|
+
smoothness: 0,
|
|
3780
|
+
roundness: 0,
|
|
3781
|
+
active: false
|
|
3782
|
+
};
|
|
3783
|
+
_this.tonemapping = {
|
|
3784
|
+
active: false
|
|
3785
|
+
};
|
|
3786
|
+
_this.colorAdjustments = {
|
|
3787
|
+
brightness: 0,
|
|
3788
|
+
saturation: 0,
|
|
3789
|
+
contrast: 0,
|
|
3790
|
+
active: false
|
|
3791
|
+
};
|
|
3787
3792
|
return _this;
|
|
3788
3793
|
}
|
|
3789
3794
|
var _proto = PostProcessVolume.prototype;
|
|
@@ -3797,36 +3802,18 @@ var PostProcessVolume = /*#__PURE__*/ function(Behaviour) {
|
|
|
3797
3802
|
}(Behaviour);
|
|
3798
3803
|
__decorate([
|
|
3799
3804
|
serialize()
|
|
3800
|
-
], PostProcessVolume.prototype, "
|
|
3801
|
-
__decorate([
|
|
3802
|
-
serialize()
|
|
3803
|
-
], PostProcessVolume.prototype, "threshold", void 0);
|
|
3804
|
-
__decorate([
|
|
3805
|
-
serialize()
|
|
3806
|
-
], PostProcessVolume.prototype, "bloomIntensity", void 0);
|
|
3807
|
-
__decorate([
|
|
3808
|
-
serialize()
|
|
3809
|
-
], PostProcessVolume.prototype, "brightness", void 0);
|
|
3810
|
-
__decorate([
|
|
3811
|
-
serialize()
|
|
3812
|
-
], PostProcessVolume.prototype, "saturation", void 0);
|
|
3813
|
-
__decorate([
|
|
3814
|
-
serialize()
|
|
3815
|
-
], PostProcessVolume.prototype, "contrast", void 0);
|
|
3805
|
+
], PostProcessVolume.prototype, "bloom", void 0);
|
|
3816
3806
|
__decorate([
|
|
3817
3807
|
serialize()
|
|
3818
|
-
], PostProcessVolume.prototype, "
|
|
3808
|
+
], PostProcessVolume.prototype, "vignette", void 0);
|
|
3819
3809
|
__decorate([
|
|
3820
3810
|
serialize()
|
|
3821
|
-
], PostProcessVolume.prototype, "
|
|
3811
|
+
], PostProcessVolume.prototype, "tonemapping", void 0);
|
|
3822
3812
|
__decorate([
|
|
3823
3813
|
serialize()
|
|
3824
|
-
], PostProcessVolume.prototype, "
|
|
3825
|
-
__decorate([
|
|
3826
|
-
serialize()
|
|
3827
|
-
], PostProcessVolume.prototype, "toneMappingEnabled", void 0);
|
|
3814
|
+
], PostProcessVolume.prototype, "colorAdjustments", void 0);
|
|
3828
3815
|
PostProcessVolume = __decorate([
|
|
3829
|
-
effectsClass(
|
|
3816
|
+
effectsClass(DataType.PostProcessVolume)
|
|
3830
3817
|
], PostProcessVolume);
|
|
3831
3818
|
|
|
3832
3819
|
function _assert_this_initialized(self) {
|
|
@@ -6913,6 +6900,7 @@ var MaterialRenderType;
|
|
|
6913
6900
|
_this.enabledMacros = {};
|
|
6914
6901
|
_this.destroyed = false;
|
|
6915
6902
|
_this.initialized = false;
|
|
6903
|
+
_this.shaderDirty = true;
|
|
6916
6904
|
if (props) {
|
|
6917
6905
|
var _props_name = props.name, name = _props_name === void 0 ? "Material" + seed$8++ : _props_name, _props_renderType = props.renderType, renderType = _props_renderType === void 0 ? 0 : _props_renderType, shader = props.shader, uniformSemantics = props.uniformSemantics;
|
|
6918
6906
|
_this.name = name;
|
|
@@ -6940,6 +6928,19 @@ var MaterialRenderType;
|
|
|
6940
6928
|
// OVERRIDE
|
|
6941
6929
|
};
|
|
6942
6930
|
_create_class(Material, [
|
|
6931
|
+
{
|
|
6932
|
+
key: "shader",
|
|
6933
|
+
get: function get() {
|
|
6934
|
+
return this._shader;
|
|
6935
|
+
},
|
|
6936
|
+
set: function set(value) {
|
|
6937
|
+
if (this._shader === value) {
|
|
6938
|
+
return;
|
|
6939
|
+
}
|
|
6940
|
+
this._shader = value;
|
|
6941
|
+
this.shaderDirty = true;
|
|
6942
|
+
}
|
|
6943
|
+
},
|
|
6943
6944
|
{
|
|
6944
6945
|
key: "blending",
|
|
6945
6946
|
set: /******** effects-core 中会调用 引擎必须实现 ***********************/ /**
|
|
@@ -10307,15 +10308,15 @@ var BloomThresholdPass = /*#__PURE__*/ function(RenderPass) {
|
|
|
10307
10308
|
renderer.setFramebuffer(this.framebuffer);
|
|
10308
10309
|
};
|
|
10309
10310
|
_proto.execute = function execute(renderer) {
|
|
10310
|
-
var _renderer_renderingData_currentFrame_globalVolume;
|
|
10311
|
+
var _renderer_renderingData_currentFrame_globalVolume_bloom, _renderer_renderingData_currentFrame_globalVolume;
|
|
10311
10312
|
renderer.clear({
|
|
10312
10313
|
colorAction: TextureStoreAction.clear,
|
|
10313
10314
|
depthAction: TextureStoreAction.clear,
|
|
10314
10315
|
stencilAction: TextureStoreAction.clear
|
|
10315
10316
|
});
|
|
10316
10317
|
this.screenMesh.material.setTexture("_MainTex", this.mainTexture);
|
|
10317
|
-
var
|
|
10318
|
-
var threshold = (
|
|
10318
|
+
var _renderer_renderingData_currentFrame_globalVolume_bloom_threshold;
|
|
10319
|
+
var threshold = (_renderer_renderingData_currentFrame_globalVolume_bloom_threshold = (_renderer_renderingData_currentFrame_globalVolume = renderer.renderingData.currentFrame.globalVolume) == null ? void 0 : (_renderer_renderingData_currentFrame_globalVolume_bloom = _renderer_renderingData_currentFrame_globalVolume.bloom) == null ? void 0 : _renderer_renderingData_currentFrame_globalVolume_bloom.threshold) != null ? _renderer_renderingData_currentFrame_globalVolume_bloom_threshold : 1.0;
|
|
10319
10320
|
this.screenMesh.material.setFloat("_Threshold", threshold);
|
|
10320
10321
|
renderer.renderMeshes([
|
|
10321
10322
|
this.screenMesh
|
|
@@ -10528,25 +10529,44 @@ var ToneMappingPass = /*#__PURE__*/ function(RenderPass) {
|
|
|
10528
10529
|
depthAction: TextureStoreAction.clear,
|
|
10529
10530
|
stencilAction: TextureStoreAction.clear
|
|
10530
10531
|
});
|
|
10531
|
-
var
|
|
10532
|
-
var
|
|
10532
|
+
var globalVolume = renderer.renderingData.currentFrame.globalVolume;
|
|
10533
|
+
var bloom = _extends({
|
|
10534
|
+
threshold: 0,
|
|
10535
|
+
intensity: 0,
|
|
10536
|
+
active: false
|
|
10537
|
+
}, globalVolume == null ? void 0 : globalVolume.bloom);
|
|
10538
|
+
var vignette = _extends({
|
|
10539
|
+
intensity: 0,
|
|
10540
|
+
smoothness: 0,
|
|
10541
|
+
roundness: 0,
|
|
10542
|
+
active: false
|
|
10543
|
+
}, globalVolume == null ? void 0 : globalVolume.vignette);
|
|
10544
|
+
var colorAdjustments = _extends({
|
|
10545
|
+
brightness: 0,
|
|
10546
|
+
saturation: 0,
|
|
10547
|
+
contrast: 0,
|
|
10548
|
+
active: false
|
|
10549
|
+
}, globalVolume == null ? void 0 : globalVolume.colorAdjustments);
|
|
10550
|
+
var tonemapping = _extends({
|
|
10551
|
+
active: false
|
|
10552
|
+
}, globalVolume == null ? void 0 : globalVolume.tonemapping);
|
|
10533
10553
|
this.screenMesh.material.setTexture("_SceneTex", this.sceneTextureHandle.texture);
|
|
10534
|
-
this.screenMesh.material.setFloat("_Brightness", brightness);
|
|
10535
|
-
this.screenMesh.material.setFloat("_Saturation", saturation);
|
|
10536
|
-
this.screenMesh.material.setFloat("_Contrast", contrast);
|
|
10537
|
-
this.screenMesh.material.setInt("_UseBloom", Number(
|
|
10538
|
-
if (
|
|
10554
|
+
this.screenMesh.material.setFloat("_Brightness", Math.pow(2, colorAdjustments.brightness));
|
|
10555
|
+
this.screenMesh.material.setFloat("_Saturation", colorAdjustments.saturation * 0.01 + 1);
|
|
10556
|
+
this.screenMesh.material.setFloat("_Contrast", colorAdjustments.contrast * 0.01 + 1);
|
|
10557
|
+
this.screenMesh.material.setInt("_UseBloom", Number(bloom.active));
|
|
10558
|
+
if (bloom.active) {
|
|
10539
10559
|
this.screenMesh.material.setTexture("_GaussianTex", this.mainTexture);
|
|
10540
|
-
this.screenMesh.material.setFloat("_BloomIntensity",
|
|
10560
|
+
this.screenMesh.material.setFloat("_BloomIntensity", bloom.intensity);
|
|
10541
10561
|
}
|
|
10542
|
-
if (
|
|
10543
|
-
this.screenMesh.material.setFloat("_VignetteIntensity",
|
|
10544
|
-
this.screenMesh.material.setFloat("_VignetteSmoothness",
|
|
10545
|
-
this.screenMesh.material.setFloat("_VignetteRoundness",
|
|
10562
|
+
if (vignette.intensity > 0) {
|
|
10563
|
+
this.screenMesh.material.setFloat("_VignetteIntensity", vignette.intensity);
|
|
10564
|
+
this.screenMesh.material.setFloat("_VignetteSmoothness", vignette.smoothness);
|
|
10565
|
+
this.screenMesh.material.setFloat("_VignetteRoundness", vignette.roundness);
|
|
10546
10566
|
this.screenMesh.material.setVector2("_VignetteCenter", new Vector2(0.5, 0.5));
|
|
10547
10567
|
this.screenMesh.material.setVector3("_VignetteColor", new Vector3(0.0, 0.0, 0.0));
|
|
10548
10568
|
}
|
|
10549
|
-
this.screenMesh.material.setInt("_UseToneMapping", Number(
|
|
10569
|
+
this.screenMesh.material.setInt("_UseToneMapping", Number(tonemapping.active));
|
|
10550
10570
|
renderer.renderMeshes([
|
|
10551
10571
|
this.screenMesh
|
|
10552
10572
|
]);
|
|
@@ -15757,70 +15777,79 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
15757
15777
|
};
|
|
15758
15778
|
_proto.buildPath = function buildPath(data) {
|
|
15759
15779
|
this.path.clear();
|
|
15760
|
-
|
|
15761
|
-
|
|
15762
|
-
|
|
15763
|
-
|
|
15764
|
-
|
|
15765
|
-
|
|
15766
|
-
|
|
15767
|
-
|
|
15768
|
-
|
|
15769
|
-
|
|
15770
|
-
|
|
15771
|
-
|
|
15772
|
-
|
|
15773
|
-
|
|
15774
|
-
|
|
15775
|
-
|
|
15776
|
-
this.curveValues.push({
|
|
15777
|
-
point: points[pointIndex.point],
|
|
15778
|
-
controlPoint1: easingOuts[lastPointIndex.easingOut],
|
|
15779
|
-
controlPoint2: easingIns[pointIndex.easingIn]
|
|
15780
|
-
});
|
|
15781
|
-
}
|
|
15782
|
-
// Push the last curve
|
|
15780
|
+
var shapeData = data;
|
|
15781
|
+
switch(shapeData.type){
|
|
15782
|
+
case 0:
|
|
15783
|
+
{
|
|
15784
|
+
var customData = shapeData;
|
|
15785
|
+
var points = customData.points;
|
|
15786
|
+
var easingIns = customData.easingIns;
|
|
15787
|
+
var easingOuts = customData.easingOuts;
|
|
15788
|
+
this.curveValues = [];
|
|
15789
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(customData.shapes), _step; !(_step = _iterator()).done;){
|
|
15790
|
+
var shape = _step.value;
|
|
15791
|
+
this.setFillColor(shape.fill);
|
|
15792
|
+
var indices = shape.indexes;
|
|
15793
|
+
for(var i = 1; i < indices.length; i++){
|
|
15794
|
+
var pointIndex = indices[i];
|
|
15795
|
+
var lastPointIndex = indices[i - 1];
|
|
15783
15796
|
this.curveValues.push({
|
|
15784
|
-
point: points[
|
|
15785
|
-
controlPoint1: easingOuts[
|
|
15786
|
-
controlPoint2: easingIns[
|
|
15797
|
+
point: points[pointIndex.point],
|
|
15798
|
+
controlPoint1: easingOuts[lastPointIndex.easingOut],
|
|
15799
|
+
controlPoint2: easingIns[pointIndex.easingIn]
|
|
15787
15800
|
});
|
|
15788
15801
|
}
|
|
15789
|
-
|
|
15790
|
-
|
|
15791
|
-
|
|
15792
|
-
|
|
15793
|
-
|
|
15794
|
-
|
|
15795
|
-
this.path.bezierCurveTo(control1.x, control1.y, control2.x, control2.y, point.x, point.y, 1);
|
|
15796
|
-
}
|
|
15797
|
-
break;
|
|
15798
|
-
}
|
|
15799
|
-
case 2:
|
|
15800
|
-
{
|
|
15801
|
-
var ellipseData = shapeData;
|
|
15802
|
-
this.path.ellipse(0, 0, ellipseData.xRadius, ellipseData.yRadius);
|
|
15803
|
-
break;
|
|
15804
|
-
}
|
|
15805
|
-
case 1:
|
|
15806
|
-
{
|
|
15807
|
-
var rectangleData = shapeData;
|
|
15808
|
-
this.path.rect(-rectangleData.width / 2, rectangleData.height / 2, rectangleData.width, rectangleData.height);
|
|
15809
|
-
break;
|
|
15810
|
-
}
|
|
15811
|
-
case 4:
|
|
15812
|
-
{
|
|
15813
|
-
var starData = shapeData;
|
|
15814
|
-
this.path.polyStar(starData.pointCount, starData.outerRadius, starData.innerRadius, starData.outerRoundness, starData.innerRoundness, StarType.Star);
|
|
15815
|
-
break;
|
|
15802
|
+
// Push the last curve
|
|
15803
|
+
this.curveValues.push({
|
|
15804
|
+
point: points[indices[0].point],
|
|
15805
|
+
controlPoint1: easingOuts[indices[indices.length - 1].easingOut],
|
|
15806
|
+
controlPoint2: easingIns[indices[0].easingIn]
|
|
15807
|
+
});
|
|
15816
15808
|
}
|
|
15817
|
-
|
|
15818
|
-
{
|
|
15819
|
-
var
|
|
15820
|
-
|
|
15821
|
-
|
|
15809
|
+
this.path.moveTo(this.curveValues[this.curveValues.length - 1].point.x, this.curveValues[this.curveValues.length - 1].point.y);
|
|
15810
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(this.curveValues), _step1; !(_step1 = _iterator1()).done;){
|
|
15811
|
+
var curveValue = _step1.value;
|
|
15812
|
+
var point = curveValue.point;
|
|
15813
|
+
var control1 = curveValue.controlPoint1;
|
|
15814
|
+
var control2 = curveValue.controlPoint2;
|
|
15815
|
+
this.path.bezierCurveTo(control1.x, control1.y, control2.x, control2.y, point.x, point.y, 1);
|
|
15822
15816
|
}
|
|
15823
|
-
|
|
15817
|
+
break;
|
|
15818
|
+
}
|
|
15819
|
+
case 2:
|
|
15820
|
+
{
|
|
15821
|
+
var ellipseData = shapeData;
|
|
15822
|
+
this.path.ellipse(0, 0, ellipseData.xRadius, ellipseData.yRadius);
|
|
15823
|
+
this.setFillColor(ellipseData.fill);
|
|
15824
|
+
break;
|
|
15825
|
+
}
|
|
15826
|
+
case 1:
|
|
15827
|
+
{
|
|
15828
|
+
var rectangleData = shapeData;
|
|
15829
|
+
this.path.rect(-rectangleData.width / 2, rectangleData.height / 2, rectangleData.width, rectangleData.height);
|
|
15830
|
+
this.setFillColor(rectangleData.fill);
|
|
15831
|
+
break;
|
|
15832
|
+
}
|
|
15833
|
+
case 4:
|
|
15834
|
+
{
|
|
15835
|
+
var starData = shapeData;
|
|
15836
|
+
this.path.polyStar(starData.pointCount, starData.outerRadius, starData.innerRadius, starData.outerRoundness, starData.innerRoundness, StarType.Star);
|
|
15837
|
+
this.setFillColor(starData.fill);
|
|
15838
|
+
break;
|
|
15839
|
+
}
|
|
15840
|
+
case 3:
|
|
15841
|
+
{
|
|
15842
|
+
var polygonData = shapeData;
|
|
15843
|
+
this.path.polyStar(polygonData.pointCount, polygonData.radius, polygonData.radius, polygonData.roundness, polygonData.roundness, StarType.Polygon);
|
|
15844
|
+
this.setFillColor(polygonData.fill);
|
|
15845
|
+
break;
|
|
15846
|
+
}
|
|
15847
|
+
}
|
|
15848
|
+
};
|
|
15849
|
+
_proto.setFillColor = function setFillColor(fill) {
|
|
15850
|
+
if (fill) {
|
|
15851
|
+
var color = fill.color;
|
|
15852
|
+
this.material.setColor("_Color", new Color(color.r, color.g, color.b, color.a));
|
|
15824
15853
|
}
|
|
15825
15854
|
};
|
|
15826
15855
|
_proto.fromData = function fromData(data) {
|
|
@@ -15840,26 +15869,24 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
15840
15869
|
ShapeComponent = __decorate([
|
|
15841
15870
|
effectsClass("ShapeComponent")
|
|
15842
15871
|
], ShapeComponent);
|
|
15843
|
-
var
|
|
15844
|
-
(function(
|
|
15872
|
+
var ShapePrimitiveType;
|
|
15873
|
+
(function(ShapePrimitiveType) {
|
|
15845
15874
|
/**
|
|
15846
15875
|
* 自定义图形
|
|
15847
|
-
*/
|
|
15876
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Custom"] = 0] = "Custom";
|
|
15848
15877
|
/**
|
|
15849
15878
|
* 矩形
|
|
15850
|
-
*/
|
|
15879
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Rectangle"] = 1] = "Rectangle";
|
|
15851
15880
|
/**
|
|
15852
15881
|
* 椭圆
|
|
15853
|
-
*/
|
|
15882
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Ellipse"] = 2] = "Ellipse";
|
|
15854
15883
|
/**
|
|
15855
15884
|
* 多边形
|
|
15856
|
-
*/
|
|
15885
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Polygon"] = 3] = "Polygon";
|
|
15857
15886
|
/**
|
|
15858
15887
|
* 星形
|
|
15859
|
-
*/
|
|
15860
|
-
})(
|
|
15861
|
-
var ShapeData = function ShapeData() {
|
|
15862
|
-
};
|
|
15888
|
+
*/ ShapePrimitiveType[ShapePrimitiveType["Star"] = 4] = "Star";
|
|
15889
|
+
})(ShapePrimitiveType || (ShapePrimitiveType = {}));
|
|
15863
15890
|
var ShapeConnectType;
|
|
15864
15891
|
(function(ShapeConnectType) {})(ShapeConnectType || (ShapeConnectType = {}));
|
|
15865
15892
|
var ShapePointType;
|
|
@@ -16361,8 +16388,8 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16361
16388
|
0
|
|
16362
16389
|
]
|
|
16363
16390
|
};
|
|
16391
|
+
_this.duringPlay = false;
|
|
16364
16392
|
/** 是否响应点击和拖拽交互事件 */ _this._interactive = true;
|
|
16365
|
-
_this.hasBeenAddedToComposition = false;
|
|
16366
16393
|
_this.getHitTestParams = function(force) {
|
|
16367
16394
|
if (!_this.clickable) {
|
|
16368
16395
|
return;
|
|
@@ -16399,7 +16426,6 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16399
16426
|
];
|
|
16400
16427
|
};
|
|
16401
16428
|
_proto.onStart = function onStart() {
|
|
16402
|
-
var _this = this;
|
|
16403
16429
|
var options = this.item.props.content.options;
|
|
16404
16430
|
var env = this.item.engine.renderer.env;
|
|
16405
16431
|
var composition = this.item.composition;
|
|
@@ -16423,32 +16449,35 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16423
16449
|
this.materials = this.previewContent.mesh.materials;
|
|
16424
16450
|
}
|
|
16425
16451
|
this.item.getHitTestParams = this.getHitTestParams;
|
|
16426
|
-
|
|
16427
|
-
|
|
16428
|
-
|
|
16429
|
-
|
|
16430
|
-
|
|
16431
|
-
|
|
16432
|
-
|
|
16433
|
-
_this.endDragTarget();
|
|
16452
|
+
};
|
|
16453
|
+
_proto.onDisable = function onDisable() {
|
|
16454
|
+
if (this.item && this.item.composition) {
|
|
16455
|
+
var _this_previewContent;
|
|
16456
|
+
if (this.duringPlay) {
|
|
16457
|
+
this.item.composition.removeInteractiveItem(this.item, this.item.props.content.options.type);
|
|
16458
|
+
this.duringPlay = false;
|
|
16434
16459
|
}
|
|
16435
|
-
|
|
16460
|
+
this.clickable = false;
|
|
16461
|
+
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.mesh.dispose();
|
|
16462
|
+
this.endDragTarget();
|
|
16463
|
+
}
|
|
16464
|
+
};
|
|
16465
|
+
_proto.onEnable = function onEnable() {
|
|
16466
|
+
var type = this.interactData.options.type;
|
|
16467
|
+
if (type === InteractType.CLICK) {
|
|
16468
|
+
this.clickable = true;
|
|
16469
|
+
}
|
|
16436
16470
|
};
|
|
16437
16471
|
_proto.onUpdate = function onUpdate(dt) {
|
|
16438
16472
|
var _this_previewContent;
|
|
16439
|
-
|
|
16440
|
-
|
|
16441
|
-
|
|
16442
|
-
|
|
16443
|
-
if (!this.hasBeenAddedToComposition && this.item.composition) {
|
|
16444
|
-
var type = this.interactData.options.type;
|
|
16445
|
-
if (type === InteractType.CLICK) {
|
|
16446
|
-
this.clickable = true;
|
|
16447
|
-
}
|
|
16473
|
+
this.duringPlay = true;
|
|
16474
|
+
// trigger messageBegin when item enter
|
|
16475
|
+
if (this.item.time > 0 && this.item.time - dt / 1000 <= 0) {
|
|
16476
|
+
var _this_item_composition;
|
|
16448
16477
|
var options = this.item.props.content.options;
|
|
16449
|
-
this.item.composition.addInteractiveItem(this.item, options.type);
|
|
16450
|
-
this.hasBeenAddedToComposition = true;
|
|
16478
|
+
(_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.addInteractiveItem(this.item, options.type);
|
|
16451
16479
|
}
|
|
16480
|
+
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.updateMesh();
|
|
16452
16481
|
if (!this.dragEvent || !this.bouncingArg) {
|
|
16453
16482
|
return;
|
|
16454
16483
|
}
|
|
@@ -16862,6 +16891,7 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
|
|
|
16862
16891
|
if (inputCount === void 0) inputCount = 0;
|
|
16863
16892
|
this.onPlayablePlayFlag = true;
|
|
16864
16893
|
this.onPlayablePauseFlag = false;
|
|
16894
|
+
this.duration = 0;
|
|
16865
16895
|
this.destroyed = false;
|
|
16866
16896
|
this.inputs = [];
|
|
16867
16897
|
this.inputOuputPorts = [];
|
|
@@ -16954,6 +16984,12 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
|
|
|
16954
16984
|
_proto.getTime = function getTime() {
|
|
16955
16985
|
return this.time;
|
|
16956
16986
|
};
|
|
16987
|
+
_proto.setDuration = function setDuration(duration) {
|
|
16988
|
+
this.duration = duration;
|
|
16989
|
+
};
|
|
16990
|
+
_proto.getDuration = function getDuration() {
|
|
16991
|
+
return this.duration;
|
|
16992
|
+
};
|
|
16957
16993
|
_proto.getPlayState = function getPlayState() {
|
|
16958
16994
|
return this.playState;
|
|
16959
16995
|
};
|
|
@@ -17670,17 +17706,15 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17670
17706
|
/**
|
|
17671
17707
|
* 元素动画结束时行为(如何处理元素)
|
|
17672
17708
|
*/ _this.endBehavior = EndBehavior.forward;
|
|
17673
|
-
/**
|
|
17674
|
-
* 元素是否可用
|
|
17675
|
-
*/ _this.ended = false;
|
|
17676
|
-
_this.reusable = false;
|
|
17677
17709
|
_this.type = ItemType.base;
|
|
17678
17710
|
_this.isDuringPlay = false;
|
|
17679
17711
|
_this.components = [];
|
|
17680
17712
|
_this.rendererComponents = [];
|
|
17681
17713
|
/**
|
|
17682
|
-
*
|
|
17683
|
-
|
|
17714
|
+
* 元素是否激活
|
|
17715
|
+
*/ _this.active = true;
|
|
17716
|
+
/**
|
|
17717
|
+
* 元素组件是否显示,用于批量开关元素组件
|
|
17684
17718
|
*/ _this.visible = true;
|
|
17685
17719
|
/**
|
|
17686
17720
|
* 元素动画的速度
|
|
@@ -17811,12 +17845,6 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17811
17845
|
}
|
|
17812
17846
|
};
|
|
17813
17847
|
/**
|
|
17814
|
-
* 元素动画结束播放时回调函数
|
|
17815
|
-
* @override
|
|
17816
|
-
*/ _proto.onEnd = function onEnd() {
|
|
17817
|
-
// OVERRIDE
|
|
17818
|
-
};
|
|
17819
|
-
/**
|
|
17820
17848
|
* 通过指定 r、g、b、a 值设置元素的颜色
|
|
17821
17849
|
* @param {number} r
|
|
17822
17850
|
* @param {number} g
|
|
@@ -17829,17 +17857,27 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17829
17857
|
* @param opacity - 透明度值,范围 [0,1]
|
|
17830
17858
|
*/ _proto.setOpacity = function setOpacity(opacity) {};
|
|
17831
17859
|
/**
|
|
17832
|
-
*
|
|
17833
|
-
*/ _proto.
|
|
17834
|
-
|
|
17860
|
+
* 激活或停用 VFXItem
|
|
17861
|
+
*/ _proto.setActive = function setActive(value) {
|
|
17862
|
+
if (this.active !== value) {
|
|
17863
|
+
this.active = !!value;
|
|
17864
|
+
this.onActiveChanged();
|
|
17865
|
+
}
|
|
17835
17866
|
};
|
|
17836
17867
|
/**
|
|
17837
|
-
*
|
|
17868
|
+
* 设置元素的显隐,该设置会批量开关元素组件
|
|
17838
17869
|
*/ _proto.setVisible = function setVisible(visible) {
|
|
17839
|
-
|
|
17840
|
-
|
|
17841
|
-
|
|
17870
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.components), _step; !(_step = _iterator()).done;){
|
|
17871
|
+
var component = _step.value;
|
|
17872
|
+
component.enabled = visible;
|
|
17842
17873
|
}
|
|
17874
|
+
this.visible = visible;
|
|
17875
|
+
};
|
|
17876
|
+
/**
|
|
17877
|
+
* 元素组件显隐状态
|
|
17878
|
+
* @deprecated use isVisible instead
|
|
17879
|
+
*/ _proto.getVisible = function getVisible() {
|
|
17880
|
+
return this.visible;
|
|
17843
17881
|
};
|
|
17844
17882
|
/**
|
|
17845
17883
|
* 获取元素变换包括位置、旋转、缩放
|
|
@@ -17921,14 +17959,6 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17921
17959
|
this.transform.assignWorldTRS(pos);
|
|
17922
17960
|
return pos;
|
|
17923
17961
|
};
|
|
17924
|
-
/**
|
|
17925
|
-
* 是否到达元素的结束时间
|
|
17926
|
-
* @param now
|
|
17927
|
-
* @returns
|
|
17928
|
-
*/ _proto.isEnded = function isEnded(now) {
|
|
17929
|
-
// at least 1 ms
|
|
17930
|
-
return now - this.duration > 0.001;
|
|
17931
|
-
};
|
|
17932
17962
|
_proto.find = function find(name) {
|
|
17933
17963
|
var _queue;
|
|
17934
17964
|
if (this.name === name) {
|
|
@@ -17952,7 +17982,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17952
17982
|
* @internal
|
|
17953
17983
|
*/ _proto.beginPlay = function beginPlay() {
|
|
17954
17984
|
this.isDuringPlay = true;
|
|
17955
|
-
if (this.composition && this.
|
|
17985
|
+
if (this.composition && this.active && !this.isEnabled) {
|
|
17956
17986
|
this.onEnable();
|
|
17957
17987
|
}
|
|
17958
17988
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.children), _step; !(_step = _iterator()).done;){
|
|
@@ -18228,6 +18258,22 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
18228
18258
|
}
|
|
18229
18259
|
}
|
|
18230
18260
|
}
|
|
18261
|
+
},
|
|
18262
|
+
{
|
|
18263
|
+
key: "isActive",
|
|
18264
|
+
get: /**
|
|
18265
|
+
* 当前 VFXItem 是否激活
|
|
18266
|
+
*/ function get() {
|
|
18267
|
+
return this.active;
|
|
18268
|
+
}
|
|
18269
|
+
},
|
|
18270
|
+
{
|
|
18271
|
+
key: "isVisible",
|
|
18272
|
+
get: /**
|
|
18273
|
+
* 元素组件显隐状态
|
|
18274
|
+
*/ function get() {
|
|
18275
|
+
return this.visible;
|
|
18276
|
+
}
|
|
18231
18277
|
}
|
|
18232
18278
|
]);
|
|
18233
18279
|
return VFXItem;
|
|
@@ -18898,7 +18944,7 @@ var ShapeNone = /*#__PURE__*/ function() {
|
|
|
18898
18944
|
return ShapeNone;
|
|
18899
18945
|
}();
|
|
18900
18946
|
var _obj$2;
|
|
18901
|
-
var map = (_obj$2 = {}, _obj$2[ShapeType
|
|
18947
|
+
var map = (_obj$2 = {}, _obj$2[ShapeType.NONE] = ShapeNone, _obj$2[ShapeType.CONE] = Cone, _obj$2[ShapeType.SPHERE] = Sphere, _obj$2[ShapeType.HEMISPHERE] = Hemisphere, _obj$2[ShapeType.CIRCLE] = Circle, _obj$2[ShapeType.DONUT] = Donut, _obj$2[ShapeType.RECTANGLE] = Rectangle, _obj$2[ShapeType.EDGE] = Edge, _obj$2[ShapeType.RECTANGLE_EDGE] = RectangleEdge, _obj$2[ShapeType.TEXTURE] = TextureShape, _obj$2);
|
|
18902
18948
|
function createShape(shapeOptions) {
|
|
18903
18949
|
if (!shapeOptions) {
|
|
18904
18950
|
return new ShapeNone();
|
|
@@ -18915,7 +18961,7 @@ function createShape(shapeOptions) {
|
|
|
18915
18961
|
throw new Error("Invalid shape: " + type + ".");
|
|
18916
18962
|
}
|
|
18917
18963
|
var ctrl = new Ctrl(options);
|
|
18918
|
-
if (type !== ShapeType
|
|
18964
|
+
if (type !== ShapeType.NONE) {
|
|
18919
18965
|
var alignSpeedDirection = shapeOptions.alignSpeedDirection, _shapeOptions_upDirection = shapeOptions.upDirection, upDirection = _shapeOptions_upDirection === void 0 ? [
|
|
18920
18966
|
0,
|
|
18921
18967
|
0,
|
|
@@ -22992,6 +23038,7 @@ var TrackAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
22992
23038
|
for(var _iterator = _create_for_of_iterator_helper_loose(timelineClips), _step; !(_step = _iterator()).done;){
|
|
22993
23039
|
var timelineClip = _step.value;
|
|
22994
23040
|
var clipPlayable = this.createClipPlayable(graph, timelineClip);
|
|
23041
|
+
clipPlayable.setDuration(timelineClip.duration);
|
|
22995
23042
|
var clip = new RuntimeClip(timelineClip, clipPlayable, mixer, this);
|
|
22996
23043
|
runtimeClips.push(clip);
|
|
22997
23044
|
mixer.addInput(clipPlayable, 0);
|
|
@@ -23095,14 +23142,6 @@ var RuntimeClip = /*#__PURE__*/ function() {
|
|
|
23095
23142
|
this.playable.setTime(clipTime);
|
|
23096
23143
|
// 判断动画是否结束
|
|
23097
23144
|
if (ended) {
|
|
23098
|
-
if (_instanceof1(boundObject, VFXItem) && !boundObject.ended) {
|
|
23099
|
-
boundObject.ended = true;
|
|
23100
|
-
boundObject.onEnd();
|
|
23101
|
-
if (!boundObject.compositionReusable && !boundObject.reusable) {
|
|
23102
|
-
boundObject.dispose();
|
|
23103
|
-
this.playable.dispose();
|
|
23104
|
-
}
|
|
23105
|
-
}
|
|
23106
23145
|
if (this.playable.getPlayState() === PlayState.Playing) {
|
|
23107
23146
|
this.playable.pause();
|
|
23108
23147
|
}
|
|
@@ -23145,26 +23184,10 @@ var ActivationMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23145
23184
|
}
|
|
23146
23185
|
if (hasInput) {
|
|
23147
23186
|
boundItem.transform.setValid(true);
|
|
23148
|
-
|
|
23187
|
+
boundItem.setActive(true);
|
|
23149
23188
|
} else {
|
|
23150
23189
|
boundItem.transform.setValid(false);
|
|
23151
|
-
|
|
23152
|
-
}
|
|
23153
|
-
};
|
|
23154
|
-
_proto.hideRendererComponents = function hideRendererComponents(item) {
|
|
23155
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(item.rendererComponents), _step; !(_step = _iterator()).done;){
|
|
23156
|
-
var rendererComponent = _step.value;
|
|
23157
|
-
if (rendererComponent.enabled) {
|
|
23158
|
-
rendererComponent.enabled = false;
|
|
23159
|
-
}
|
|
23160
|
-
}
|
|
23161
|
-
};
|
|
23162
|
-
_proto.showRendererComponents = function showRendererComponents(item) {
|
|
23163
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(item.rendererComponents), _step; !(_step = _iterator()).done;){
|
|
23164
|
-
var rendererComponent = _step.value;
|
|
23165
|
-
if (!rendererComponent.enabled) {
|
|
23166
|
-
rendererComponent.enabled = true;
|
|
23167
|
-
}
|
|
23190
|
+
boundItem.setActive(false);
|
|
23168
23191
|
}
|
|
23169
23192
|
};
|
|
23170
23193
|
return ActivationMixerPlayable;
|
|
@@ -23192,7 +23215,7 @@ var PropertyClipPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23192
23215
|
}
|
|
23193
23216
|
var _proto = PropertyClipPlayable.prototype;
|
|
23194
23217
|
_proto.processFrame = function processFrame(context) {
|
|
23195
|
-
this.value = this.curve.getValue(this.time);
|
|
23218
|
+
this.value = this.curve.getValue(this.time / this.getDuration());
|
|
23196
23219
|
};
|
|
23197
23220
|
return PropertyClipPlayable;
|
|
23198
23221
|
}(Playable);
|
|
@@ -23710,9 +23733,6 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
23710
23733
|
var track = _step.value;
|
|
23711
23734
|
var boundObject = track.boundObject;
|
|
23712
23735
|
if (_instanceof1(boundObject, VFXItem)) {
|
|
23713
|
-
if (_instanceof1(track, ObjectBindingTrack)) {
|
|
23714
|
-
boundObject.reusable = value;
|
|
23715
|
-
}
|
|
23716
23736
|
var subCompositionComponent = boundObject.getComponent(CompositionComponent);
|
|
23717
23737
|
if (subCompositionComponent) {
|
|
23718
23738
|
subCompositionComponent.setReusable(value);
|
|
@@ -23757,16 +23777,16 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
23757
23777
|
}
|
|
23758
23778
|
}
|
|
23759
23779
|
};
|
|
23760
|
-
_proto.
|
|
23780
|
+
_proto.onEnable = function onEnable() {
|
|
23761
23781
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.items), _step; !(_step = _iterator()).done;){
|
|
23762
23782
|
var item = _step.value;
|
|
23763
|
-
item.
|
|
23783
|
+
item.setActive(true);
|
|
23764
23784
|
}
|
|
23765
23785
|
};
|
|
23766
|
-
_proto.
|
|
23786
|
+
_proto.onDisable = function onDisable() {
|
|
23767
23787
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.items), _step; !(_step = _iterator()).done;){
|
|
23768
23788
|
var item = _step.value;
|
|
23769
|
-
item.
|
|
23789
|
+
item.setActive(false);
|
|
23770
23790
|
}
|
|
23771
23791
|
};
|
|
23772
23792
|
_proto.onDestroy = function onDestroy() {
|
|
@@ -23782,7 +23802,7 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
23782
23802
|
_proto.hitTest = function hitTest(ray, x, y, regions, force, options) {
|
|
23783
23803
|
var _this, _loop = function(i) {
|
|
23784
23804
|
var item = _this.items[i];
|
|
23785
|
-
if (item.
|
|
23805
|
+
if (item.isActive && item.transform.getValid() && !VFXItem.isComposition(item) && !skip(item)) {
|
|
23786
23806
|
var hitParams = item.getHitTestParams(force);
|
|
23787
23807
|
if (hitParams) {
|
|
23788
23808
|
var success = false;
|
|
@@ -23924,9 +23944,9 @@ var SubCompositionMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23924
23944
|
}
|
|
23925
23945
|
}
|
|
23926
23946
|
if (hasInput) {
|
|
23927
|
-
compositionComponent.
|
|
23947
|
+
compositionComponent.item.setActive(true);
|
|
23928
23948
|
} else {
|
|
23929
|
-
compositionComponent.
|
|
23949
|
+
compositionComponent.item.setActive(false);
|
|
23930
23950
|
}
|
|
23931
23951
|
};
|
|
23932
23952
|
return SubCompositionMixerPlayable;
|
|
@@ -24591,6 +24611,8 @@ var TextComponent = /*#__PURE__*/ function(BaseRenderComponent) {
|
|
|
24591
24611
|
/**
|
|
24592
24612
|
* 文本行数
|
|
24593
24613
|
*/ _this.lineCount = 0;
|
|
24614
|
+
_this.SCALE_FACTOR = 0.1;
|
|
24615
|
+
_this.ALPHA_FIX_VALUE = 1 / 255;
|
|
24594
24616
|
_this.name = "MText" + seed$1++;
|
|
24595
24617
|
_this.geometry = _this.createGeometry(glContext.TRIANGLES);
|
|
24596
24618
|
if (props) {
|
|
@@ -26284,13 +26306,13 @@ function getStandardParticleContent(particle) {
|
|
|
26284
26306
|
var options = particle.options;
|
|
26285
26307
|
var transform = particle.transform;
|
|
26286
26308
|
var shape = {
|
|
26287
|
-
type: ShapeType
|
|
26309
|
+
type: ShapeType.NONE
|
|
26288
26310
|
};
|
|
26289
26311
|
if (particle.shape) {
|
|
26290
26312
|
var _particle_shape_shape;
|
|
26291
26313
|
var shapeType = (_particle_shape_shape = particle.shape.shape) == null ? void 0 : _particle_shape_shape.replace(/([A-Z])/g, "_$1").toUpperCase().replace(/^_/, "");
|
|
26292
26314
|
shape = _extends({}, particle.shape, {
|
|
26293
|
-
type: ShapeType
|
|
26315
|
+
type: ShapeType[shapeType]
|
|
26294
26316
|
});
|
|
26295
26317
|
if (particle.shape.upDirection) {
|
|
26296
26318
|
var _particle_shape_upDirection = particle.shape.upDirection, x = _particle_shape_upDirection[0], y = _particle_shape_upDirection[1], z = _particle_shape_upDirection[2];
|
|
@@ -28381,6 +28403,9 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28381
28403
|
* 动画播放速度
|
|
28382
28404
|
*/ _this.speed = 1;
|
|
28383
28405
|
/**
|
|
28406
|
+
* 合成是否结束
|
|
28407
|
+
*/ _this.isEnded = false;
|
|
28408
|
+
/**
|
|
28384
28409
|
* 用于保存与当前合成相关的插件数据
|
|
28385
28410
|
*/ _this.loaderData = {};
|
|
28386
28411
|
/**
|
|
@@ -28402,6 +28427,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28402
28427
|
* 合成暂停/播放 标识
|
|
28403
28428
|
*/ _this.paused = false;
|
|
28404
28429
|
_this.lastVideoUpdateTime = 0;
|
|
28430
|
+
_this.isEndCalled = false;
|
|
28405
28431
|
var _props_reusable = props.reusable, reusable = _props_reusable === void 0 ? false : _props_reusable, _props_speed = props.speed, speed = _props_speed === void 0 ? 1 : _props_speed, _props_baseRenderOrder = props.baseRenderOrder, baseRenderOrder = _props_baseRenderOrder === void 0 ? 0 : _props_baseRenderOrder, renderer = props.renderer, event = props.event, width = props.width, height = props.height, handleItemMessage = props.handleItemMessage;
|
|
28406
28432
|
_this.compositionSourceManager = new CompositionSourceManager(scene, renderer.engine);
|
|
28407
28433
|
if (reusable) {
|
|
@@ -28491,7 +28517,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28491
28517
|
* @param visible - 是否可见
|
|
28492
28518
|
*/ _proto.setVisible = function setVisible(visible) {
|
|
28493
28519
|
this.items.forEach(function(item) {
|
|
28494
|
-
item.
|
|
28520
|
+
item.setActive(visible);
|
|
28495
28521
|
});
|
|
28496
28522
|
};
|
|
28497
28523
|
/**
|
|
@@ -28501,7 +28527,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28501
28527
|
return this.speed;
|
|
28502
28528
|
};
|
|
28503
28529
|
_proto.play = function play() {
|
|
28504
|
-
if (this.
|
|
28530
|
+
if (this.isEnded && this.reusable) {
|
|
28505
28531
|
this.restart();
|
|
28506
28532
|
}
|
|
28507
28533
|
if (this.rootComposition.isStartCalled) {
|
|
@@ -28592,7 +28618,8 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28592
28618
|
* 重置状态函数
|
|
28593
28619
|
*/ _proto.reset = function reset() {
|
|
28594
28620
|
this.rendererOptions = null;
|
|
28595
|
-
this.
|
|
28621
|
+
this.isEnded = false;
|
|
28622
|
+
this.isEndCalled = false;
|
|
28596
28623
|
this.rootComposition.time = 0;
|
|
28597
28624
|
this.pluginSystem.resetComposition(this, this.renderFrame);
|
|
28598
28625
|
};
|
|
@@ -28644,12 +28671,18 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28644
28671
|
this.sceneTicking.lateUpdate.tick(dt);
|
|
28645
28672
|
this.updateCamera();
|
|
28646
28673
|
this.prepareRender();
|
|
28674
|
+
if (this.isEnded && !this.isEndCalled) {
|
|
28675
|
+
this.isEndCalled = true;
|
|
28676
|
+
this.emit("end", {
|
|
28677
|
+
composition: this
|
|
28678
|
+
});
|
|
28679
|
+
}
|
|
28647
28680
|
if (this.shouldDispose()) {
|
|
28648
28681
|
this.dispose();
|
|
28649
28682
|
}
|
|
28650
28683
|
};
|
|
28651
28684
|
_proto.shouldDispose = function shouldDispose() {
|
|
28652
|
-
return this.
|
|
28685
|
+
return this.isEnded && this.rootItem.endBehavior === EndBehavior.destroy && !this.reusable;
|
|
28653
28686
|
};
|
|
28654
28687
|
_proto.getUpdateTime = function getUpdateTime(t) {
|
|
28655
28688
|
var startTimeInMs = this.startTime * 1000;
|
|
@@ -28740,11 +28773,11 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28740
28773
|
*/ _proto.updateRootComposition = function updateRootComposition(deltaTime) {
|
|
28741
28774
|
if (this.rootComposition.isActiveAndEnabled) {
|
|
28742
28775
|
var localTime = this.time + deltaTime - this.rootItem.start;
|
|
28743
|
-
var
|
|
28776
|
+
var isEnded = false;
|
|
28744
28777
|
var duration = this.rootItem.duration;
|
|
28745
28778
|
var endBehavior = this.rootItem.endBehavior;
|
|
28746
28779
|
if (localTime - duration > 0.001) {
|
|
28747
|
-
|
|
28780
|
+
isEnded = true;
|
|
28748
28781
|
switch(endBehavior){
|
|
28749
28782
|
case EndBehavior.restart:
|
|
28750
28783
|
{
|
|
@@ -28768,11 +28801,14 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28768
28801
|
}
|
|
28769
28802
|
}
|
|
28770
28803
|
this.rootComposition.time = localTime;
|
|
28771
|
-
|
|
28772
|
-
|
|
28773
|
-
|
|
28774
|
-
|
|
28775
|
-
}
|
|
28804
|
+
// end state changed, handle onEnd flags
|
|
28805
|
+
if (this.isEnded !== isEnded) {
|
|
28806
|
+
if (isEnded) {
|
|
28807
|
+
this.isEnded = true;
|
|
28808
|
+
} else {
|
|
28809
|
+
this.isEnded = false;
|
|
28810
|
+
this.isEndCalled = false;
|
|
28811
|
+
}
|
|
28776
28812
|
}
|
|
28777
28813
|
}
|
|
28778
28814
|
};
|
|
@@ -31098,8 +31134,8 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
|
|
|
31098
31134
|
registerPlugin("particle", ParticleLoader, VFXItem, true);
|
|
31099
31135
|
registerPlugin("cal", CalculateLoader, VFXItem, true);
|
|
31100
31136
|
registerPlugin("interact", InteractLoader, VFXItem, true);
|
|
31101
|
-
var version = "2.1.0-alpha.
|
|
31137
|
+
var version = "2.1.0-alpha.12";
|
|
31102
31138
|
logger.info("Core version: " + version + ".");
|
|
31103
31139
|
|
|
31104
|
-
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, 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, 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, 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, ShapeConnectType,
|
|
31140
|
+
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, 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, 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, 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, ShapeConnectType, ShapePointType, ShapePrimitiveType, 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, Vector4Curve, 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 };
|
|
31105
31141
|
//# sourceMappingURL=index.mjs.map
|