@galacean/effects-core 2.1.0-alpha.10 → 2.1.0-alpha.11
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 +256 -227
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +264 -234
- 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 +2 -1
- 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.11
|
|
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);
|
|
3805
|
+
], PostProcessVolume.prototype, "bloom", void 0);
|
|
3804
3806
|
__decorate([
|
|
3805
3807
|
serialize()
|
|
3806
|
-
], PostProcessVolume.prototype, "
|
|
3808
|
+
], PostProcessVolume.prototype, "vignette", void 0);
|
|
3807
3809
|
__decorate([
|
|
3808
3810
|
serialize()
|
|
3809
|
-
], PostProcessVolume.prototype, "
|
|
3811
|
+
], PostProcessVolume.prototype, "tonemapping", void 0);
|
|
3810
3812
|
__decorate([
|
|
3811
3813
|
serialize()
|
|
3812
|
-
], PostProcessVolume.prototype, "
|
|
3813
|
-
__decorate([
|
|
3814
|
-
serialize()
|
|
3815
|
-
], PostProcessVolume.prototype, "contrast", void 0);
|
|
3816
|
-
__decorate([
|
|
3817
|
-
serialize()
|
|
3818
|
-
], PostProcessVolume.prototype, "vignetteIntensity", void 0);
|
|
3819
|
-
__decorate([
|
|
3820
|
-
serialize()
|
|
3821
|
-
], PostProcessVolume.prototype, "vignetteSmoothness", void 0);
|
|
3822
|
-
__decorate([
|
|
3823
|
-
serialize()
|
|
3824
|
-
], PostProcessVolume.prototype, "vignetteRoundness", void 0);
|
|
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;
|
|
@@ -16362,7 +16389,6 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16362
16389
|
]
|
|
16363
16390
|
};
|
|
16364
16391
|
/** 是否响应点击和拖拽交互事件 */ _this._interactive = true;
|
|
16365
|
-
_this.hasBeenAddedToComposition = false;
|
|
16366
16392
|
_this.getHitTestParams = function(force) {
|
|
16367
16393
|
if (!_this.clickable) {
|
|
16368
16394
|
return;
|
|
@@ -16399,7 +16425,6 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16399
16425
|
];
|
|
16400
16426
|
};
|
|
16401
16427
|
_proto.onStart = function onStart() {
|
|
16402
|
-
var _this = this;
|
|
16403
16428
|
var options = this.item.props.content.options;
|
|
16404
16429
|
var env = this.item.engine.renderer.env;
|
|
16405
16430
|
var composition = this.item.composition;
|
|
@@ -16423,16 +16448,25 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16423
16448
|
this.materials = this.previewContent.mesh.materials;
|
|
16424
16449
|
}
|
|
16425
16450
|
this.item.getHitTestParams = this.getHitTestParams;
|
|
16426
|
-
|
|
16427
|
-
|
|
16428
|
-
|
|
16429
|
-
|
|
16430
|
-
|
|
16431
|
-
|
|
16432
|
-
|
|
16433
|
-
|
|
16434
|
-
|
|
16435
|
-
|
|
16451
|
+
};
|
|
16452
|
+
_proto.onDisable = function onDisable() {
|
|
16453
|
+
if (this.item && this.item.composition) {
|
|
16454
|
+
var _this_previewContent;
|
|
16455
|
+
this.item.composition.removeInteractiveItem(this.item, this.item.props.content.options.type);
|
|
16456
|
+
this.clickable = false;
|
|
16457
|
+
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.mesh.dispose();
|
|
16458
|
+
this.endDragTarget();
|
|
16459
|
+
}
|
|
16460
|
+
};
|
|
16461
|
+
_proto.onEnable = function onEnable() {
|
|
16462
|
+
var type = this.interactData.options.type;
|
|
16463
|
+
if (type === InteractType.CLICK) {
|
|
16464
|
+
this.clickable = true;
|
|
16465
|
+
}
|
|
16466
|
+
var options = this.item.props.content.options;
|
|
16467
|
+
if (this.item.composition) {
|
|
16468
|
+
this.item.composition.addInteractiveItem(this.item, options.type);
|
|
16469
|
+
}
|
|
16436
16470
|
};
|
|
16437
16471
|
_proto.onUpdate = function onUpdate(dt) {
|
|
16438
16472
|
var _this_previewContent;
|
|
@@ -16440,15 +16474,6 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16440
16474
|
return;
|
|
16441
16475
|
}
|
|
16442
16476
|
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.updateMesh();
|
|
16443
|
-
if (!this.hasBeenAddedToComposition && this.item.composition) {
|
|
16444
|
-
var type = this.interactData.options.type;
|
|
16445
|
-
if (type === InteractType.CLICK) {
|
|
16446
|
-
this.clickable = true;
|
|
16447
|
-
}
|
|
16448
|
-
var options = this.item.props.content.options;
|
|
16449
|
-
this.item.composition.addInteractiveItem(this.item, options.type);
|
|
16450
|
-
this.hasBeenAddedToComposition = true;
|
|
16451
|
-
}
|
|
16452
16477
|
if (!this.dragEvent || !this.bouncingArg) {
|
|
16453
16478
|
return;
|
|
16454
16479
|
}
|
|
@@ -16862,6 +16887,7 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
|
|
|
16862
16887
|
if (inputCount === void 0) inputCount = 0;
|
|
16863
16888
|
this.onPlayablePlayFlag = true;
|
|
16864
16889
|
this.onPlayablePauseFlag = false;
|
|
16890
|
+
this.duration = 0;
|
|
16865
16891
|
this.destroyed = false;
|
|
16866
16892
|
this.inputs = [];
|
|
16867
16893
|
this.inputOuputPorts = [];
|
|
@@ -16954,6 +16980,12 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
|
|
|
16954
16980
|
_proto.getTime = function getTime() {
|
|
16955
16981
|
return this.time;
|
|
16956
16982
|
};
|
|
16983
|
+
_proto.setDuration = function setDuration(duration) {
|
|
16984
|
+
this.duration = duration;
|
|
16985
|
+
};
|
|
16986
|
+
_proto.getDuration = function getDuration() {
|
|
16987
|
+
return this.duration;
|
|
16988
|
+
};
|
|
16957
16989
|
_proto.getPlayState = function getPlayState() {
|
|
16958
16990
|
return this.playState;
|
|
16959
16991
|
};
|
|
@@ -17670,17 +17702,15 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17670
17702
|
/**
|
|
17671
17703
|
* 元素动画结束时行为(如何处理元素)
|
|
17672
17704
|
*/ _this.endBehavior = EndBehavior.forward;
|
|
17673
|
-
/**
|
|
17674
|
-
* 元素是否可用
|
|
17675
|
-
*/ _this.ended = false;
|
|
17676
|
-
_this.reusable = false;
|
|
17677
17705
|
_this.type = ItemType.base;
|
|
17678
17706
|
_this.isDuringPlay = false;
|
|
17679
17707
|
_this.components = [];
|
|
17680
17708
|
_this.rendererComponents = [];
|
|
17681
17709
|
/**
|
|
17682
|
-
*
|
|
17683
|
-
|
|
17710
|
+
* 元素是否激活
|
|
17711
|
+
*/ _this.active = true;
|
|
17712
|
+
/**
|
|
17713
|
+
* 元素组件是否显示,用于批量开关元素组件
|
|
17684
17714
|
*/ _this.visible = true;
|
|
17685
17715
|
/**
|
|
17686
17716
|
* 元素动画的速度
|
|
@@ -17811,12 +17841,6 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17811
17841
|
}
|
|
17812
17842
|
};
|
|
17813
17843
|
/**
|
|
17814
|
-
* 元素动画结束播放时回调函数
|
|
17815
|
-
* @override
|
|
17816
|
-
*/ _proto.onEnd = function onEnd() {
|
|
17817
|
-
// OVERRIDE
|
|
17818
|
-
};
|
|
17819
|
-
/**
|
|
17820
17844
|
* 通过指定 r、g、b、a 值设置元素的颜色
|
|
17821
17845
|
* @param {number} r
|
|
17822
17846
|
* @param {number} g
|
|
@@ -17829,17 +17853,27 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17829
17853
|
* @param opacity - 透明度值,范围 [0,1]
|
|
17830
17854
|
*/ _proto.setOpacity = function setOpacity(opacity) {};
|
|
17831
17855
|
/**
|
|
17832
|
-
*
|
|
17833
|
-
*/ _proto.
|
|
17834
|
-
|
|
17856
|
+
* 激活或停用 VFXItem
|
|
17857
|
+
*/ _proto.setActive = function setActive(value) {
|
|
17858
|
+
if (this.active !== value) {
|
|
17859
|
+
this.active = !!value;
|
|
17860
|
+
this.onActiveChanged();
|
|
17861
|
+
}
|
|
17835
17862
|
};
|
|
17836
17863
|
/**
|
|
17837
|
-
*
|
|
17864
|
+
* 设置元素的显隐,该设置会批量开关元素组件
|
|
17838
17865
|
*/ _proto.setVisible = function setVisible(visible) {
|
|
17839
|
-
|
|
17840
|
-
|
|
17841
|
-
|
|
17866
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(this.components), _step; !(_step = _iterator()).done;){
|
|
17867
|
+
var component = _step.value;
|
|
17868
|
+
component.enabled = visible;
|
|
17842
17869
|
}
|
|
17870
|
+
this.visible = visible;
|
|
17871
|
+
};
|
|
17872
|
+
/**
|
|
17873
|
+
* 元素组件显隐状态
|
|
17874
|
+
* @deprecated use isVisible instead
|
|
17875
|
+
*/ _proto.getVisible = function getVisible() {
|
|
17876
|
+
return this.visible;
|
|
17843
17877
|
};
|
|
17844
17878
|
/**
|
|
17845
17879
|
* 获取元素变换包括位置、旋转、缩放
|
|
@@ -17921,14 +17955,6 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17921
17955
|
this.transform.assignWorldTRS(pos);
|
|
17922
17956
|
return pos;
|
|
17923
17957
|
};
|
|
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
17958
|
_proto.find = function find(name) {
|
|
17933
17959
|
var _queue;
|
|
17934
17960
|
if (this.name === name) {
|
|
@@ -17952,7 +17978,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
17952
17978
|
* @internal
|
|
17953
17979
|
*/ _proto.beginPlay = function beginPlay() {
|
|
17954
17980
|
this.isDuringPlay = true;
|
|
17955
|
-
if (this.composition && this.
|
|
17981
|
+
if (this.composition && this.active && !this.isEnabled) {
|
|
17956
17982
|
this.onEnable();
|
|
17957
17983
|
}
|
|
17958
17984
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.children), _step; !(_step = _iterator()).done;){
|
|
@@ -18228,6 +18254,22 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
18228
18254
|
}
|
|
18229
18255
|
}
|
|
18230
18256
|
}
|
|
18257
|
+
},
|
|
18258
|
+
{
|
|
18259
|
+
key: "isActive",
|
|
18260
|
+
get: /**
|
|
18261
|
+
* 当前 VFXItem 是否激活
|
|
18262
|
+
*/ function get() {
|
|
18263
|
+
return this.active;
|
|
18264
|
+
}
|
|
18265
|
+
},
|
|
18266
|
+
{
|
|
18267
|
+
key: "isVisible",
|
|
18268
|
+
get: /**
|
|
18269
|
+
* 元素组件显隐状态
|
|
18270
|
+
*/ function get() {
|
|
18271
|
+
return this.visible;
|
|
18272
|
+
}
|
|
18231
18273
|
}
|
|
18232
18274
|
]);
|
|
18233
18275
|
return VFXItem;
|
|
@@ -18898,7 +18940,7 @@ var ShapeNone = /*#__PURE__*/ function() {
|
|
|
18898
18940
|
return ShapeNone;
|
|
18899
18941
|
}();
|
|
18900
18942
|
var _obj$2;
|
|
18901
|
-
var map = (_obj$2 = {}, _obj$2[ShapeType
|
|
18943
|
+
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
18944
|
function createShape(shapeOptions) {
|
|
18903
18945
|
if (!shapeOptions) {
|
|
18904
18946
|
return new ShapeNone();
|
|
@@ -18915,7 +18957,7 @@ function createShape(shapeOptions) {
|
|
|
18915
18957
|
throw new Error("Invalid shape: " + type + ".");
|
|
18916
18958
|
}
|
|
18917
18959
|
var ctrl = new Ctrl(options);
|
|
18918
|
-
if (type !== ShapeType
|
|
18960
|
+
if (type !== ShapeType.NONE) {
|
|
18919
18961
|
var alignSpeedDirection = shapeOptions.alignSpeedDirection, _shapeOptions_upDirection = shapeOptions.upDirection, upDirection = _shapeOptions_upDirection === void 0 ? [
|
|
18920
18962
|
0,
|
|
18921
18963
|
0,
|
|
@@ -22992,6 +23034,7 @@ var TrackAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
22992
23034
|
for(var _iterator = _create_for_of_iterator_helper_loose(timelineClips), _step; !(_step = _iterator()).done;){
|
|
22993
23035
|
var timelineClip = _step.value;
|
|
22994
23036
|
var clipPlayable = this.createClipPlayable(graph, timelineClip);
|
|
23037
|
+
clipPlayable.setDuration(timelineClip.duration);
|
|
22995
23038
|
var clip = new RuntimeClip(timelineClip, clipPlayable, mixer, this);
|
|
22996
23039
|
runtimeClips.push(clip);
|
|
22997
23040
|
mixer.addInput(clipPlayable, 0);
|
|
@@ -23095,14 +23138,6 @@ var RuntimeClip = /*#__PURE__*/ function() {
|
|
|
23095
23138
|
this.playable.setTime(clipTime);
|
|
23096
23139
|
// 判断动画是否结束
|
|
23097
23140
|
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
23141
|
if (this.playable.getPlayState() === PlayState.Playing) {
|
|
23107
23142
|
this.playable.pause();
|
|
23108
23143
|
}
|
|
@@ -23145,26 +23180,10 @@ var ActivationMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23145
23180
|
}
|
|
23146
23181
|
if (hasInput) {
|
|
23147
23182
|
boundItem.transform.setValid(true);
|
|
23148
|
-
|
|
23183
|
+
boundItem.setActive(true);
|
|
23149
23184
|
} else {
|
|
23150
23185
|
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
|
-
}
|
|
23186
|
+
boundItem.setActive(false);
|
|
23168
23187
|
}
|
|
23169
23188
|
};
|
|
23170
23189
|
return ActivationMixerPlayable;
|
|
@@ -23192,7 +23211,7 @@ var PropertyClipPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23192
23211
|
}
|
|
23193
23212
|
var _proto = PropertyClipPlayable.prototype;
|
|
23194
23213
|
_proto.processFrame = function processFrame(context) {
|
|
23195
|
-
this.value = this.curve.getValue(this.time);
|
|
23214
|
+
this.value = this.curve.getValue(this.time / this.getDuration());
|
|
23196
23215
|
};
|
|
23197
23216
|
return PropertyClipPlayable;
|
|
23198
23217
|
}(Playable);
|
|
@@ -23710,9 +23729,6 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
23710
23729
|
var track = _step.value;
|
|
23711
23730
|
var boundObject = track.boundObject;
|
|
23712
23731
|
if (_instanceof1(boundObject, VFXItem)) {
|
|
23713
|
-
if (_instanceof1(track, ObjectBindingTrack)) {
|
|
23714
|
-
boundObject.reusable = value;
|
|
23715
|
-
}
|
|
23716
23732
|
var subCompositionComponent = boundObject.getComponent(CompositionComponent);
|
|
23717
23733
|
if (subCompositionComponent) {
|
|
23718
23734
|
subCompositionComponent.setReusable(value);
|
|
@@ -23757,16 +23773,16 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
23757
23773
|
}
|
|
23758
23774
|
}
|
|
23759
23775
|
};
|
|
23760
|
-
_proto.
|
|
23776
|
+
_proto.onEnable = function onEnable() {
|
|
23761
23777
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.items), _step; !(_step = _iterator()).done;){
|
|
23762
23778
|
var item = _step.value;
|
|
23763
|
-
item.
|
|
23779
|
+
item.setActive(true);
|
|
23764
23780
|
}
|
|
23765
23781
|
};
|
|
23766
|
-
_proto.
|
|
23782
|
+
_proto.onDisable = function onDisable() {
|
|
23767
23783
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.items), _step; !(_step = _iterator()).done;){
|
|
23768
23784
|
var item = _step.value;
|
|
23769
|
-
item.
|
|
23785
|
+
item.setActive(false);
|
|
23770
23786
|
}
|
|
23771
23787
|
};
|
|
23772
23788
|
_proto.onDestroy = function onDestroy() {
|
|
@@ -23782,7 +23798,7 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
23782
23798
|
_proto.hitTest = function hitTest(ray, x, y, regions, force, options) {
|
|
23783
23799
|
var _this, _loop = function(i) {
|
|
23784
23800
|
var item = _this.items[i];
|
|
23785
|
-
if (item.
|
|
23801
|
+
if (item.isActive && item.transform.getValid() && !VFXItem.isComposition(item) && !skip(item)) {
|
|
23786
23802
|
var hitParams = item.getHitTestParams(force);
|
|
23787
23803
|
if (hitParams) {
|
|
23788
23804
|
var success = false;
|
|
@@ -23924,9 +23940,9 @@ var SubCompositionMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
23924
23940
|
}
|
|
23925
23941
|
}
|
|
23926
23942
|
if (hasInput) {
|
|
23927
|
-
compositionComponent.
|
|
23943
|
+
compositionComponent.item.setActive(true);
|
|
23928
23944
|
} else {
|
|
23929
|
-
compositionComponent.
|
|
23945
|
+
compositionComponent.item.setActive(false);
|
|
23930
23946
|
}
|
|
23931
23947
|
};
|
|
23932
23948
|
return SubCompositionMixerPlayable;
|
|
@@ -26284,13 +26300,13 @@ function getStandardParticleContent(particle) {
|
|
|
26284
26300
|
var options = particle.options;
|
|
26285
26301
|
var transform = particle.transform;
|
|
26286
26302
|
var shape = {
|
|
26287
|
-
type: ShapeType
|
|
26303
|
+
type: ShapeType.NONE
|
|
26288
26304
|
};
|
|
26289
26305
|
if (particle.shape) {
|
|
26290
26306
|
var _particle_shape_shape;
|
|
26291
26307
|
var shapeType = (_particle_shape_shape = particle.shape.shape) == null ? void 0 : _particle_shape_shape.replace(/([A-Z])/g, "_$1").toUpperCase().replace(/^_/, "");
|
|
26292
26308
|
shape = _extends({}, particle.shape, {
|
|
26293
|
-
type: ShapeType
|
|
26309
|
+
type: ShapeType[shapeType]
|
|
26294
26310
|
});
|
|
26295
26311
|
if (particle.shape.upDirection) {
|
|
26296
26312
|
var _particle_shape_upDirection = particle.shape.upDirection, x = _particle_shape_upDirection[0], y = _particle_shape_upDirection[1], z = _particle_shape_upDirection[2];
|
|
@@ -28381,6 +28397,9 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28381
28397
|
* 动画播放速度
|
|
28382
28398
|
*/ _this.speed = 1;
|
|
28383
28399
|
/**
|
|
28400
|
+
* 合成是否结束
|
|
28401
|
+
*/ _this.isEnded = false;
|
|
28402
|
+
/**
|
|
28384
28403
|
* 用于保存与当前合成相关的插件数据
|
|
28385
28404
|
*/ _this.loaderData = {};
|
|
28386
28405
|
/**
|
|
@@ -28402,6 +28421,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28402
28421
|
* 合成暂停/播放 标识
|
|
28403
28422
|
*/ _this.paused = false;
|
|
28404
28423
|
_this.lastVideoUpdateTime = 0;
|
|
28424
|
+
_this.isEndCalled = false;
|
|
28405
28425
|
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
28426
|
_this.compositionSourceManager = new CompositionSourceManager(scene, renderer.engine);
|
|
28407
28427
|
if (reusable) {
|
|
@@ -28491,7 +28511,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28491
28511
|
* @param visible - 是否可见
|
|
28492
28512
|
*/ _proto.setVisible = function setVisible(visible) {
|
|
28493
28513
|
this.items.forEach(function(item) {
|
|
28494
|
-
item.
|
|
28514
|
+
item.setActive(visible);
|
|
28495
28515
|
});
|
|
28496
28516
|
};
|
|
28497
28517
|
/**
|
|
@@ -28501,7 +28521,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28501
28521
|
return this.speed;
|
|
28502
28522
|
};
|
|
28503
28523
|
_proto.play = function play() {
|
|
28504
|
-
if (this.
|
|
28524
|
+
if (this.isEnded && this.reusable) {
|
|
28505
28525
|
this.restart();
|
|
28506
28526
|
}
|
|
28507
28527
|
if (this.rootComposition.isStartCalled) {
|
|
@@ -28592,7 +28612,8 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28592
28612
|
* 重置状态函数
|
|
28593
28613
|
*/ _proto.reset = function reset() {
|
|
28594
28614
|
this.rendererOptions = null;
|
|
28595
|
-
this.
|
|
28615
|
+
this.isEnded = false;
|
|
28616
|
+
this.isEndCalled = false;
|
|
28596
28617
|
this.rootComposition.time = 0;
|
|
28597
28618
|
this.pluginSystem.resetComposition(this, this.renderFrame);
|
|
28598
28619
|
};
|
|
@@ -28644,12 +28665,18 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28644
28665
|
this.sceneTicking.lateUpdate.tick(dt);
|
|
28645
28666
|
this.updateCamera();
|
|
28646
28667
|
this.prepareRender();
|
|
28668
|
+
if (this.isEnded && !this.isEndCalled) {
|
|
28669
|
+
this.isEndCalled = true;
|
|
28670
|
+
this.emit("end", {
|
|
28671
|
+
composition: this
|
|
28672
|
+
});
|
|
28673
|
+
}
|
|
28647
28674
|
if (this.shouldDispose()) {
|
|
28648
28675
|
this.dispose();
|
|
28649
28676
|
}
|
|
28650
28677
|
};
|
|
28651
28678
|
_proto.shouldDispose = function shouldDispose() {
|
|
28652
|
-
return this.
|
|
28679
|
+
return this.isEnded && this.rootItem.endBehavior === EndBehavior.destroy && !this.reusable;
|
|
28653
28680
|
};
|
|
28654
28681
|
_proto.getUpdateTime = function getUpdateTime(t) {
|
|
28655
28682
|
var startTimeInMs = this.startTime * 1000;
|
|
@@ -28740,11 +28767,11 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28740
28767
|
*/ _proto.updateRootComposition = function updateRootComposition(deltaTime) {
|
|
28741
28768
|
if (this.rootComposition.isActiveAndEnabled) {
|
|
28742
28769
|
var localTime = this.time + deltaTime - this.rootItem.start;
|
|
28743
|
-
var
|
|
28770
|
+
var isEnded = false;
|
|
28744
28771
|
var duration = this.rootItem.duration;
|
|
28745
28772
|
var endBehavior = this.rootItem.endBehavior;
|
|
28746
28773
|
if (localTime - duration > 0.001) {
|
|
28747
|
-
|
|
28774
|
+
isEnded = true;
|
|
28748
28775
|
switch(endBehavior){
|
|
28749
28776
|
case EndBehavior.restart:
|
|
28750
28777
|
{
|
|
@@ -28768,11 +28795,14 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28768
28795
|
}
|
|
28769
28796
|
}
|
|
28770
28797
|
this.rootComposition.time = localTime;
|
|
28771
|
-
|
|
28772
|
-
|
|
28773
|
-
|
|
28774
|
-
|
|
28775
|
-
}
|
|
28798
|
+
// end state changed, handle onEnd flags
|
|
28799
|
+
if (this.isEnded !== isEnded) {
|
|
28800
|
+
if (isEnded) {
|
|
28801
|
+
this.isEnded = true;
|
|
28802
|
+
} else {
|
|
28803
|
+
this.isEnded = false;
|
|
28804
|
+
this.isEndCalled = false;
|
|
28805
|
+
}
|
|
28776
28806
|
}
|
|
28777
28807
|
}
|
|
28778
28808
|
};
|
|
@@ -31098,8 +31128,8 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
|
|
|
31098
31128
|
registerPlugin("particle", ParticleLoader, VFXItem, true);
|
|
31099
31129
|
registerPlugin("cal", CalculateLoader, VFXItem, true);
|
|
31100
31130
|
registerPlugin("interact", InteractLoader, VFXItem, true);
|
|
31101
|
-
var version = "2.1.0-alpha.
|
|
31131
|
+
var version = "2.1.0-alpha.11";
|
|
31102
31132
|
logger.info("Core version: " + version + ".");
|
|
31103
31133
|
|
|
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,
|
|
31134
|
+
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
31135
|
//# sourceMappingURL=index.mjs.map
|