@galacean/effects-core 2.0.0-alpha.8 → 2.0.0-alpha.9
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/asset-manager.d.ts +1 -75
- package/dist/canvas-pool.d.ts +10 -0
- package/dist/composition.d.ts +7 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +138 -123
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +136 -123
- package/dist/index.mjs.map +1 -1
- package/dist/material/material.d.ts +12 -1
- package/dist/plugin-system.d.ts +1 -2
- package/dist/plugins/plugin.d.ts +1 -2
- package/dist/plugins/sprite/sprite-item.d.ts +13 -0
- package/dist/plugins/text/text-item.d.ts +1 -0
- package/dist/render/index.d.ts +1 -0
- package/dist/render/render-frame.d.ts +2 -2
- package/dist/render/render-pass.d.ts +2 -2
- package/dist/{semantic-map.d.ts → render/semantic-map.d.ts} +3 -3
- package/dist/scene.d.ts +79 -3
- package/dist/template-image.d.ts +1 -12
- package/dist/texture/texture.d.ts +6 -0
- package/package.json +1 -1
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.0.0-alpha.
|
|
6
|
+
* Version: v2.0.0-alpha.9
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -8987,6 +8987,22 @@ let seed$8 = 1;
|
|
|
8987
8987
|
/**
|
|
8988
8988
|
* Texture 抽象类
|
|
8989
8989
|
*/ class Texture extends EffectsObject {
|
|
8990
|
+
/**
|
|
8991
|
+
* 通过 URL 创建 Texture 对象。
|
|
8992
|
+
* @param url - 要创建的 Texture URL
|
|
8993
|
+
* @since 2.0.0
|
|
8994
|
+
*/ static fromImage(url, engine) {
|
|
8995
|
+
return _async_to_generator(function*() {
|
|
8996
|
+
const image = yield loadImage(url);
|
|
8997
|
+
const texture = Texture.create(engine, {
|
|
8998
|
+
sourceType: TextureSourceType.image,
|
|
8999
|
+
image,
|
|
9000
|
+
id: generateGUID$1()
|
|
9001
|
+
});
|
|
9002
|
+
texture.initialize();
|
|
9003
|
+
return texture;
|
|
9004
|
+
})();
|
|
9005
|
+
}
|
|
8990
9006
|
get isDestroyed() {
|
|
8991
9007
|
return this.destroyed;
|
|
8992
9008
|
}
|
|
@@ -9785,14 +9801,10 @@ let seed$6 = 1;
|
|
|
9785
9801
|
if (!this.getVisible()) {
|
|
9786
9802
|
return;
|
|
9787
9803
|
}
|
|
9788
|
-
const material = this.material;
|
|
9789
|
-
const geo = this.geometry;
|
|
9790
9804
|
if (renderer.renderingData.currentFrame.globalUniforms) {
|
|
9791
9805
|
renderer.setGlobalMatrix('effects_ObjectToWorld', this.worldMatrix);
|
|
9792
9806
|
}
|
|
9793
|
-
|
|
9794
|
-
geo.flush();
|
|
9795
|
-
renderer.drawGeometry(geo, material);
|
|
9807
|
+
renderer.drawGeometry(this.geometry, this.material);
|
|
9796
9808
|
}
|
|
9797
9809
|
/**
|
|
9798
9810
|
* 获取当前 Mesh 的第一个 geometry。
|
|
@@ -12735,6 +12747,23 @@ class SpriteComponent extends RendererComponent {
|
|
|
12735
12747
|
*/ getVisible() {
|
|
12736
12748
|
return this.visible;
|
|
12737
12749
|
}
|
|
12750
|
+
/**
|
|
12751
|
+
* 设置当前图层的颜色
|
|
12752
|
+
* > Tips: 透明度也属于颜色的一部分,当有透明度/颜色 K 帧变化时,该 API 会失效
|
|
12753
|
+
* @since 2.0.0
|
|
12754
|
+
* @param color - 颜色值
|
|
12755
|
+
*/ setColor(color) {
|
|
12756
|
+
this.color = color;
|
|
12757
|
+
this.material.setVector4('_Color', new Vector4().setFromArray(color));
|
|
12758
|
+
}
|
|
12759
|
+
/**
|
|
12760
|
+
* 设置当前 Mesh 的纹理
|
|
12761
|
+
* @since 2.0.0
|
|
12762
|
+
* @param texture - 纹理对象
|
|
12763
|
+
*/ setTexture(texture) {
|
|
12764
|
+
this.renderer.texture = texture;
|
|
12765
|
+
this.material.setTexture('uSampler0', texture);
|
|
12766
|
+
}
|
|
12738
12767
|
render(renderer) {
|
|
12739
12768
|
if (!this.getVisible()) {
|
|
12740
12769
|
return;
|
|
@@ -12745,8 +12774,6 @@ class SpriteComponent extends RendererComponent {
|
|
|
12745
12774
|
renderer.setGlobalMatrix('effects_ObjectToWorld', this.transform.getWorldMatrix());
|
|
12746
12775
|
}
|
|
12747
12776
|
this.material.setVector2('_Size', this.transform.size);
|
|
12748
|
-
// 执行 Geometry 的数据刷新
|
|
12749
|
-
geo.flush();
|
|
12750
12777
|
renderer.drawGeometry(geo, material);
|
|
12751
12778
|
}
|
|
12752
12779
|
start() {
|
|
@@ -13166,7 +13193,7 @@ SpriteComponent = __decorate([
|
|
|
13166
13193
|
|
|
13167
13194
|
const RUNTIME_ENV = 'runtime_env';
|
|
13168
13195
|
const RENDER_PREFER_LOOKUP_TEXTURE = 'lookup_texture';
|
|
13169
|
-
//
|
|
13196
|
+
// 文本元素使用 offscreen canvas 绘制
|
|
13170
13197
|
const TEMPLATE_USE_OFFSCREEN_CANVAS = 'offscreen_canvas';
|
|
13171
13198
|
// 后处理配置相关
|
|
13172
13199
|
const POST_PROCESS_SETTINGS = 'post_process_settings';
|
|
@@ -16946,21 +16973,14 @@ class TextStyle {
|
|
|
16946
16973
|
}
|
|
16947
16974
|
}
|
|
16948
16975
|
|
|
16949
|
-
const DEFAULT_FONTS = [
|
|
16950
|
-
'serif',
|
|
16951
|
-
'sans-serif',
|
|
16952
|
-
'monospace',
|
|
16953
|
-
'courier'
|
|
16954
|
-
];
|
|
16955
16976
|
class CanvasPool {
|
|
16956
16977
|
dispose() {
|
|
16957
16978
|
this.elements.forEach((e)=>e.remove());
|
|
16958
|
-
//
|
|
16959
|
-
this.elements =
|
|
16979
|
+
// clearing the array
|
|
16980
|
+
this.elements.length = 0;
|
|
16960
16981
|
}
|
|
16961
16982
|
getCanvas() {
|
|
16962
|
-
if (this.elements.length) {
|
|
16963
|
-
// @ts-expect-error
|
|
16983
|
+
if (this.elements.length !== 0) {
|
|
16964
16984
|
return this.elements.shift();
|
|
16965
16985
|
}
|
|
16966
16986
|
if (getConfig(TEMPLATE_USE_OFFSCREEN_CANVAS)) {
|
|
@@ -16975,12 +16995,13 @@ class CanvasPool {
|
|
|
16975
16995
|
return defCanvas;
|
|
16976
16996
|
}
|
|
16977
16997
|
}
|
|
16978
|
-
saveCanvas(
|
|
16979
|
-
|
|
16998
|
+
saveCanvas(canvas) {
|
|
16999
|
+
canvas.width = 1;
|
|
17000
|
+
canvas.height = 1;
|
|
16980
17001
|
if (this.elements.length < 3) {
|
|
16981
|
-
addItem(this.elements,
|
|
17002
|
+
addItem(this.elements, canvas);
|
|
16982
17003
|
} else {
|
|
16983
|
-
|
|
17004
|
+
canvas.remove();
|
|
16984
17005
|
}
|
|
16985
17006
|
}
|
|
16986
17007
|
constructor(){
|
|
@@ -16991,62 +17012,13 @@ const canvasPool = new CanvasPool();
|
|
|
16991
17012
|
function getDefaultTemplateCanvasPool() {
|
|
16992
17013
|
return canvasPool;
|
|
16993
17014
|
}
|
|
16994
|
-
function getBackgroundImage(template, variables) {
|
|
16995
|
-
let templateBackground;
|
|
16996
|
-
var _template_background;
|
|
16997
|
-
const { name, url } = (_template_background = template == null ? void 0 : template.background) != null ? _template_background : {};
|
|
16998
|
-
if (name) {
|
|
16999
|
-
if (variables && variables[name]) {
|
|
17000
|
-
templateBackground = variables[name];
|
|
17001
|
-
} else if (url) {
|
|
17002
|
-
templateBackground = url;
|
|
17003
|
-
}
|
|
17004
|
-
}
|
|
17005
|
-
return templateBackground;
|
|
17006
|
-
}
|
|
17007
|
-
function drawImageByTemplate(image, template, variables) {
|
|
17008
|
-
return _drawImageByTemplate.apply(this, arguments);
|
|
17009
|
-
}
|
|
17010
|
-
function _drawImageByTemplate() {
|
|
17011
|
-
_drawImageByTemplate = _async_to_generator(function*(image, template, variables) {
|
|
17012
|
-
if (!image) {
|
|
17013
|
-
throw Error('image not provided');
|
|
17014
|
-
}
|
|
17015
|
-
if (!template) {
|
|
17016
|
-
return image;
|
|
17017
|
-
}
|
|
17018
|
-
let drawImage = image;
|
|
17019
|
-
// 获取动态换图的图片对象或 url 地址
|
|
17020
|
-
const templateBackground = getBackgroundImage(template, variables);
|
|
17021
|
-
if (templateBackground && templateBackground !== image.src) {
|
|
17022
|
-
drawImage = isString(templateBackground) ? yield loadImage(templateBackground) : templateBackground;
|
|
17023
|
-
}
|
|
17024
|
-
return drawImage;
|
|
17025
|
-
});
|
|
17026
|
-
return _drawImageByTemplate.apply(this, arguments);
|
|
17027
|
-
}
|
|
17028
|
-
/**
|
|
17029
|
-
* @param url
|
|
17030
|
-
* @param template
|
|
17031
|
-
* @param variables
|
|
17032
|
-
* @param options
|
|
17033
|
-
* @returns
|
|
17034
|
-
*/ function combineImageTemplate(url, template, variables) {
|
|
17035
|
-
return _combineImageTemplate.apply(this, arguments);
|
|
17036
|
-
}
|
|
17037
|
-
function _combineImageTemplate() {
|
|
17038
|
-
_combineImageTemplate = _async_to_generator(function*(url, template, variables) {
|
|
17039
|
-
let image;
|
|
17040
|
-
if (typeof url === 'string') {
|
|
17041
|
-
image = yield loadImage(url);
|
|
17042
|
-
} else {
|
|
17043
|
-
image = url;
|
|
17044
|
-
}
|
|
17045
|
-
return drawImageByTemplate(image, template, variables);
|
|
17046
|
-
});
|
|
17047
|
-
return _combineImageTemplate.apply(this, arguments);
|
|
17048
|
-
}
|
|
17049
17015
|
|
|
17016
|
+
const DEFAULT_FONTS = [
|
|
17017
|
+
'serif',
|
|
17018
|
+
'sans-serif',
|
|
17019
|
+
'monospace',
|
|
17020
|
+
'courier'
|
|
17021
|
+
];
|
|
17050
17022
|
class TextComponent extends SpriteComponent {
|
|
17051
17023
|
/**
|
|
17052
17024
|
* 设置字号大小
|
|
@@ -17396,14 +17368,10 @@ class EffectComponent extends RendererComponent {
|
|
|
17396
17368
|
this.item.getHitTestParams = this.getHitTestParams;
|
|
17397
17369
|
}
|
|
17398
17370
|
render(renderer) {
|
|
17399
|
-
const material = this.material;
|
|
17400
|
-
const geo = this.geometry;
|
|
17401
17371
|
if (renderer.renderingData.currentFrame.globalUniforms) {
|
|
17402
17372
|
renderer.setGlobalMatrix('effects_ObjectToWorld', this.transform.getWorldMatrix());
|
|
17403
17373
|
}
|
|
17404
|
-
|
|
17405
|
-
geo.flush();
|
|
17406
|
-
renderer.drawGeometry(geo, material);
|
|
17374
|
+
renderer.drawGeometry(this.geometry, this.material);
|
|
17407
17375
|
}
|
|
17408
17376
|
/**
|
|
17409
17377
|
* 获取当前 Mesh 的可见性。
|
|
@@ -20201,10 +20169,64 @@ function passRenderLevel(l, renderLevel) {
|
|
|
20201
20169
|
return false;
|
|
20202
20170
|
}
|
|
20203
20171
|
|
|
20204
|
-
function
|
|
20172
|
+
function isSceneJSON(scene) {
|
|
20205
20173
|
// TODO: 判断不太优雅,后期试情况优化
|
|
20206
20174
|
return isObject(scene) && 'jsonScene' in scene;
|
|
20207
20175
|
}
|
|
20176
|
+
function isSceneURL(scene) {
|
|
20177
|
+
return isObject(scene) && 'url' in scene;
|
|
20178
|
+
}
|
|
20179
|
+
function isSceneWithOptions(scene) {
|
|
20180
|
+
// TODO: 判断不太优雅,后期试情况优化
|
|
20181
|
+
return isObject(scene) && 'options' in scene;
|
|
20182
|
+
}
|
|
20183
|
+
|
|
20184
|
+
function getBackgroundImage(template, variables) {
|
|
20185
|
+
let templateBackground;
|
|
20186
|
+
var _template_background;
|
|
20187
|
+
const { name, url } = (_template_background = template == null ? void 0 : template.background) != null ? _template_background : {};
|
|
20188
|
+
if (name) {
|
|
20189
|
+
if (variables && variables[name]) {
|
|
20190
|
+
templateBackground = variables[name];
|
|
20191
|
+
} else if (url) {
|
|
20192
|
+
templateBackground = url;
|
|
20193
|
+
}
|
|
20194
|
+
}
|
|
20195
|
+
return templateBackground;
|
|
20196
|
+
}
|
|
20197
|
+
/**
|
|
20198
|
+
* @param url
|
|
20199
|
+
* @param template
|
|
20200
|
+
* @param variables
|
|
20201
|
+
* @param options
|
|
20202
|
+
* @returns
|
|
20203
|
+
*/ function combineImageTemplate(url, template, variables) {
|
|
20204
|
+
return _combineImageTemplate.apply(this, arguments);
|
|
20205
|
+
}
|
|
20206
|
+
function _combineImageTemplate() {
|
|
20207
|
+
_combineImageTemplate = _async_to_generator(function*(url, template, variables) {
|
|
20208
|
+
let image;
|
|
20209
|
+
if (typeof url === 'string') {
|
|
20210
|
+
image = yield loadImage(url);
|
|
20211
|
+
} else {
|
|
20212
|
+
image = url;
|
|
20213
|
+
}
|
|
20214
|
+
if (!image) {
|
|
20215
|
+
throw new Error('image not provided.');
|
|
20216
|
+
}
|
|
20217
|
+
if (!template) {
|
|
20218
|
+
return image;
|
|
20219
|
+
}
|
|
20220
|
+
let drawImage = image;
|
|
20221
|
+
// 获取动态换图的图片对象或 url 地址
|
|
20222
|
+
const templateBackground = getBackgroundImage(template, variables);
|
|
20223
|
+
if (templateBackground && isString(templateBackground) && templateBackground !== image.src) {
|
|
20224
|
+
drawImage = isString(templateBackground) ? yield loadImage(templateBackground) : templateBackground;
|
|
20225
|
+
}
|
|
20226
|
+
return drawImage;
|
|
20227
|
+
});
|
|
20228
|
+
return _combineImageTemplate.apply(this, arguments);
|
|
20229
|
+
}
|
|
20208
20230
|
|
|
20209
20231
|
let seed = 1;
|
|
20210
20232
|
/**
|
|
@@ -20221,22 +20243,19 @@ let seed = 1;
|
|
|
20221
20243
|
}
|
|
20222
20244
|
/**
|
|
20223
20245
|
* 根据用户传入的参数修改场景数据
|
|
20224
|
-
*/ updateSceneData(
|
|
20246
|
+
*/ updateSceneData(items) {
|
|
20225
20247
|
const variables = this.options.variables;
|
|
20226
|
-
if (!variables || Object.keys(variables).length
|
|
20227
|
-
return
|
|
20228
|
-
}
|
|
20229
|
-
|
|
20230
|
-
|
|
20231
|
-
|
|
20232
|
-
|
|
20233
|
-
|
|
20234
|
-
item.content.options.text = textVariable;
|
|
20235
|
-
}
|
|
20248
|
+
if (!variables || Object.keys(variables).length === 0) {
|
|
20249
|
+
return;
|
|
20250
|
+
}
|
|
20251
|
+
items.forEach((item)=>{
|
|
20252
|
+
if (item.type === ItemType$1.text) {
|
|
20253
|
+
const textVariable = variables[item.name];
|
|
20254
|
+
if (textVariable) {
|
|
20255
|
+
item.content.options.text = textVariable;
|
|
20236
20256
|
}
|
|
20237
|
-
}
|
|
20257
|
+
}
|
|
20238
20258
|
});
|
|
20239
|
-
return compositions;
|
|
20240
20259
|
}
|
|
20241
20260
|
/**
|
|
20242
20261
|
* 场景创建,通过 json 创建出场景对象,并进行提前编译等工作
|
|
@@ -20264,7 +20283,7 @@ let seed = 1;
|
|
|
20264
20283
|
cancelLoading = true;
|
|
20265
20284
|
_this.removeTimer(loadTimer);
|
|
20266
20285
|
const totalTime = performance.now() - startTime;
|
|
20267
|
-
reject(`Load time out: totalTime: ${totalTime.toFixed(4)}ms ${timeInfos.join(' ')}, url: ${assetUrl}`);
|
|
20286
|
+
reject(new Error(`Load time out: totalTime: ${totalTime.toFixed(4)}ms ${timeInfos.join(' ')}, url: ${assetUrl}`));
|
|
20268
20287
|
}, _this.timeout * 1000);
|
|
20269
20288
|
_this.timers.push(loadTimer);
|
|
20270
20289
|
});
|
|
@@ -20276,10 +20295,10 @@ let seed = 1;
|
|
|
20276
20295
|
timeInfos.push(`[${label}: ${(performance.now() - st).toFixed(2)}]`);
|
|
20277
20296
|
return result;
|
|
20278
20297
|
} catch (e) {
|
|
20279
|
-
throw new Error(`
|
|
20298
|
+
throw new Error(`Load error in ${label}, ${e}`);
|
|
20280
20299
|
}
|
|
20281
20300
|
}
|
|
20282
|
-
throw new Error('
|
|
20301
|
+
throw new Error('Load canceled.');
|
|
20283
20302
|
});
|
|
20284
20303
|
const loadResourcePromise = /*#__PURE__*/ _async_to_generator(function*() {
|
|
20285
20304
|
let scene;
|
|
@@ -20294,7 +20313,7 @@ let seed = 1;
|
|
|
20294
20313
|
_this.baseUrl = url;
|
|
20295
20314
|
rawJSON = yield hookTimeInfo('loadJSON', ()=>_this.loadJSON(url));
|
|
20296
20315
|
}
|
|
20297
|
-
if (
|
|
20316
|
+
if (isSceneJSON(rawJSON)) {
|
|
20298
20317
|
// 已经加载过的 可能需要更新数据模板
|
|
20299
20318
|
scene = _extends({}, rawJSON);
|
|
20300
20319
|
if (_this.options && _this.options.variables && Object.keys(_this.options.variables).length !== 0) {
|
|
@@ -20311,7 +20330,7 @@ let seed = 1;
|
|
|
20311
20330
|
for(let i = 0; i < scene.images.length; i++){
|
|
20312
20331
|
scene.textureOptions[i].image = scene.images[i];
|
|
20313
20332
|
}
|
|
20314
|
-
|
|
20333
|
+
_this.updateSceneData(scene.jsonScene.items);
|
|
20315
20334
|
}
|
|
20316
20335
|
} else {
|
|
20317
20336
|
// TODO: JSONScene 中 bins 的类型可能为 ArrayBuffer[]
|
|
@@ -20324,7 +20343,7 @@ let seed = 1;
|
|
|
20324
20343
|
]);
|
|
20325
20344
|
yield hookTimeInfo('processFontURL', ()=>_this.processFontURL(fonts));
|
|
20326
20345
|
const loadedTextures = yield hookTimeInfo('processTextures', ()=>_this.processTextures(loadedImages, loadedBins, jsonScene));
|
|
20327
|
-
|
|
20346
|
+
_this.updateSceneData(jsonScene.items);
|
|
20328
20347
|
scene = {
|
|
20329
20348
|
url: url,
|
|
20330
20349
|
renderLevel: _this.options.renderLevel,
|
|
@@ -20461,11 +20480,9 @@ let seed = 1;
|
|
|
20461
20480
|
if ('template' in img) {
|
|
20462
20481
|
// 1. 数据模板
|
|
20463
20482
|
const template = img.template;
|
|
20464
|
-
//
|
|
20465
|
-
const
|
|
20466
|
-
|
|
20467
|
-
const background = isTemplateV2 ? template.background : undefined;
|
|
20468
|
-
if (isTemplateV2 && background) {
|
|
20483
|
+
// 获取数据模板 background 参数
|
|
20484
|
+
const background = template.background;
|
|
20485
|
+
if (background) {
|
|
20469
20486
|
const url = getBackgroundImage(template, variables);
|
|
20470
20487
|
const isVideo = background.type === BackgroundType$1.video;
|
|
20471
20488
|
// 根据背景类型确定加载函数
|
|
@@ -20486,21 +20503,7 @@ let seed = 1;
|
|
|
20486
20503
|
} catch (e) {
|
|
20487
20504
|
throw new Error(`Failed to load. Check the template or if the URL is ${isVideo ? 'video' : 'image'} type, URL: ${url}.`);
|
|
20488
20505
|
}
|
|
20489
|
-
} else {
|
|
20490
|
-
// 旧版模板或没有背景的处理
|
|
20491
|
-
try {
|
|
20492
|
-
const resultImage = yield loadWebPOptional(imageURL, webpURL);
|
|
20493
|
-
return yield combineImageTemplate(resultImage.image, template, variables);
|
|
20494
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20495
|
-
} catch (e) {
|
|
20496
|
-
throw new Error(`Failed to load. Check the template, URL: ${imageURL}.`);
|
|
20497
|
-
}
|
|
20498
20506
|
}
|
|
20499
|
-
} else if ('type' in img && img.type === 'video') {
|
|
20500
|
-
// 视频
|
|
20501
|
-
// TODO: 2024.03.28 后面考虑下掉非推荐的视频元素使用方式
|
|
20502
|
-
console.warn('The video element is deprecated. Use template BackgroundType.video instead.');
|
|
20503
|
-
return loadVideo(img.url);
|
|
20504
20507
|
} else if ('compressed' in img && useCompressedTexture && compressedTexture) {
|
|
20505
20508
|
// 2. 压缩纹理
|
|
20506
20509
|
const { compressed } = img;
|
|
@@ -20519,6 +20522,7 @@ let seed = 1;
|
|
|
20519
20522
|
return _this.loadBins(bufferURL);
|
|
20520
20523
|
}
|
|
20521
20524
|
} else if ('sourceType' in img) {
|
|
20525
|
+
// TODO: 确定是否有用
|
|
20522
20526
|
return img;
|
|
20523
20527
|
} else if (img instanceof HTMLImageElement || img instanceof HTMLCanvasElement || img instanceof HTMLVideoElement || img instanceof Texture) {
|
|
20524
20528
|
return img;
|
|
@@ -21226,6 +21230,15 @@ const tmpScale = new Vector3(1, 1, 1);
|
|
|
21226
21230
|
this.speed = speed;
|
|
21227
21231
|
}
|
|
21228
21232
|
/**
|
|
21233
|
+
* 设置合成的可见性
|
|
21234
|
+
* @since 2.0.0
|
|
21235
|
+
* @param visible - 是否可见
|
|
21236
|
+
*/ setVisible(visible) {
|
|
21237
|
+
this.items.forEach((item)=>{
|
|
21238
|
+
item.setVisible(visible);
|
|
21239
|
+
});
|
|
21240
|
+
}
|
|
21241
|
+
/**
|
|
21229
21242
|
* 获取合成的动画速度
|
|
21230
21243
|
* @returns
|
|
21231
21244
|
*/ getSpeed() {
|
|
@@ -22816,5 +22829,5 @@ registerPlugin('particle', ParticleLoader, VFXItem, true);
|
|
|
22816
22829
|
registerPlugin('cal', CalculateLoader, VFXItem, true);
|
|
22817
22830
|
registerPlugin('interact', InteractLoader, VFXItem, true);
|
|
22818
22831
|
|
|
22819
|
-
export { AbstractPlugin, ActivationPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierSegments, COMPRESSED_TEXTURE, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, Component, Composition, CompositionComponent, CompositionSourceManager, CurveValue, DEFAULT_FONTS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, Engine, EventSystem, FilterMode, Float16ArrayWrapper, FrameBuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractBehavior$1 as InteractBehavior, InteractComponent, InteractLoader, InteractMesh, Item, ItemBehaviour, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, Mesh, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderBuffer, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderer, RendererComponent, 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, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderType, ShaderVariant, SpriteColorPlayable, SpriteComponent, SpriteLoader, StaticValue, TEMPLATE_USE_OFFSCREEN_CANVAS, TextComponent, TextLoader, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, Ticker, TimelineClip, TimelineComponent, Track, Transform, TransformAnimationPlayable, TransformAnimationPlayableAsset, VFXItem, ValueGetter, addByOrder, addItem, addItemWithOrder, assertExist, asserts, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, compatible_frag as compatibleFrag, compatible_vert as compatibleVert, createCopyShader, createGLContext, createKeyFrameMeta, createShaderWithMarcos, createShape, createVFXItem, createValueGetter, deepClone, defaultGlobalVolume, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID$1 as generateGUID, generateHalfFloatTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTemplateCanvasPool, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAndroid, isArray, isFunction, isIOS, isObject,
|
|
22832
|
+
export { AbstractPlugin, ActivationPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierSegments, COMPRESSED_TEXTURE, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, Component, Composition, CompositionComponent, CompositionSourceManager, CurveValue, DEFAULT_FONTS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, Engine, EventSystem, FilterMode, Float16ArrayWrapper, FrameBuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractBehavior$1 as InteractBehavior, InteractComponent, InteractLoader, InteractMesh, Item, ItemBehaviour, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, Mesh, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderBuffer, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderer, RendererComponent, 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, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderType, ShaderVariant, SpriteColorPlayable, SpriteComponent, SpriteLoader, StaticValue, TEMPLATE_USE_OFFSCREEN_CANVAS, TextComponent, TextLoader, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, Ticker, TimelineClip, TimelineComponent, Track, Transform, TransformAnimationPlayable, TransformAnimationPlayableAsset, VFXItem, ValueGetter, addByOrder, addItem, addItemWithOrder, assertExist, asserts, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, compatible_frag as compatibleFrag, compatible_vert as compatibleVert, createCopyShader, createGLContext, createKeyFrameMeta, createShaderWithMarcos, createShape, createVFXItem, createValueGetter, deepClone, defaultGlobalVolume, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID$1 as generateGUID, generateHalfFloatTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTemplateCanvasPool, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAndroid, isArray, isFunction, isIOS, isObject, isSceneJSON, isSceneURL, isSceneWithOptions, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isWebGL2, item_define as itemDefine, itemFrag, itemFrameFrag, itemVert, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, maxSpriteTextureCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleVert, pluginLoaderMap, random, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxFragmentTextures, setSpriteMeshMaxItemCountByGPU, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecAssign, vecFill, vecMulCombine, vecNormalize };
|
|
22820
22833
|
//# sourceMappingURL=index.mjs.map
|